@startsimpli/integrations 0.2.104 → 0.2.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startsimpli/integrations",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.105",
|
|
4
4
|
"description": "Provider-agnostic types, API clients, hooks, and UI primitives for email + calendar integrations across StartSimpli apps, plus foundry customer email (subpath ./comms).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://startsimpli.com",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"react-native": ">=0.74.0",
|
|
51
51
|
"@startsimpli/ui-native": ">=0.1.10",
|
|
52
52
|
"react-native-safe-area-context": ">=4.0.0",
|
|
53
|
-
"@startsimpli/
|
|
53
|
+
"@startsimpli/ui": "^0.4.170",
|
|
54
54
|
"@startsimpli/utils": "^0.4.17",
|
|
55
|
-
"@startsimpli/
|
|
55
|
+
"@startsimpli/auth": "^0.4.49"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"react": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"react-native-safe-area-context": "~5.7.0",
|
|
101
101
|
"@startsimpli/llm": "0.4.28",
|
|
102
102
|
"@startsimpli/ui": "0.4.170",
|
|
103
|
-
"@startsimpli/ui-native": "0.1.
|
|
103
|
+
"@startsimpli/ui-native": "0.1.11",
|
|
104
104
|
"@startsimpli/auth": "0.4.49",
|
|
105
105
|
"@startsimpli/utils": "0.4.17"
|
|
106
106
|
},
|
|
@@ -37,6 +37,18 @@ describe('orphan recovery (app killed mid-recording)', () => {
|
|
|
37
37
|
expect(ids[0]).toBe(ids[1]);
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
it('queues the recovered file with the duration the device read from it (startsim-150po.9)', async () => {
|
|
41
|
+
const enqueue = vi.fn().mockResolvedValue('queued');
|
|
42
|
+
const log = vi.fn();
|
|
43
|
+
await recoverOrphans({
|
|
44
|
+
list: async () => [{ uri: 'file:///docs/AAAA-1111-bbbb.m4a', bytes: 5000, durationMs: 13781 }, { uri: 'file:///docs/CCCC-2222-dddd.m4a', bytes: 9000 }],
|
|
45
|
+
enqueue, log,
|
|
46
|
+
});
|
|
47
|
+
expect(enqueue.mock.calls[0][0]).toMatchObject({ id: 'AAAA-1111-bbbb', durationMs: 13781 });
|
|
48
|
+
expect(enqueue.mock.calls[1][0]).toMatchObject({ id: 'CCCC-2222-dddd', durationMs: 0 });
|
|
49
|
+
expect(log).toHaveBeenCalledWith('orphan.recovered', expect.objectContaining({ id: 'AAAA-1111-bbbb', durationMs: 13781 }));
|
|
50
|
+
});
|
|
51
|
+
|
|
40
52
|
it('excludes the file being recorded right now', async () => {
|
|
41
53
|
const enqueue = vi.fn().mockResolvedValue('queued');
|
|
42
54
|
await recoverOrphans({ list: async () => files, enqueue, log: vi.fn(), isActive: (uri) => uri.includes('AAAA') });
|
|
@@ -3,6 +3,8 @@ import type { QueuedUpload } from '@startsimpli/utils';
|
|
|
3
3
|
export interface RecordingFile {
|
|
4
4
|
uri: string;
|
|
5
5
|
bytes: number;
|
|
6
|
+
/** Read from the finalized file by the device (a recording killed mid-write has no stored duration). */
|
|
7
|
+
durationMs?: number;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
/** Same file name -> same id, in the charset and length the server accepts. */
|
|
@@ -32,8 +34,9 @@ export async function recoverOrphans(deps: {
|
|
|
32
34
|
deps.log('orphan.skipped', { id, uri: file.uri, bytes: file.bytes });
|
|
33
35
|
continue;
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
const durationMs = file.durationMs && file.durationMs > 0 ? Math.round(file.durationMs) : 0;
|
|
38
|
+
deps.log('orphan.recovered', { id, uri: file.uri, bytes: file.bytes, durationMs });
|
|
39
|
+
await deps.enqueue({ id, uri: file.uri, durationMs });
|
|
37
40
|
recovered += 1;
|
|
38
41
|
}
|
|
39
42
|
return { recovered, skipped };
|