cry-synced-db-client 0.1.214 → 0.1.216

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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Versions
2
2
 
3
+ ## 0.1.216 (2026-06-25)
4
+
5
+ ### `onSyncProgress` fires for every chunk (not just first per collection)
6
+
7
+ Previously `onSyncProgress` only fired for the first chunk of each collection
8
+ in server-sync phase, causing the progress bar to freeze for 30+ seconds while
9
+ large collections (osemenitevGoveda, terapije) silently processed thousands of
10
+ items. Now fires for every chunk.
11
+
12
+ New fields on `onSyncProgress`:
13
+ - `itemsCumulative: number` — running total for current collection
14
+ - `isNewCollection: boolean` — true only for the first chunk
15
+ - `processingMs: number` — total processing time (dexie + inMem)
16
+ - `dexieMs: number` — IndexedDB write time
17
+ - `inMemMs: number` — Vuex/dbx write time
18
+
19
+ ### Configurable sync batch size (`syncBatchSize`)
20
+
21
+ `SyncedDbConfig.syncBatchSize` controls how many items `processIncomingServerData`
22
+ processes per batch. Default 5000 (was hardcoded 2000). Larger batches mean fewer
23
+ IndexedDB transactions, reducing queue buildup for large collections.
24
+
25
+ ### Fixed: scope-exit skip on initial sync (cry-db 2.5.6)
26
+
27
+ When timestamp is 0 (initial sync), `findNewerManyStream` no longer runs a
28
+ pointless scope-exit full-collection scan with `matchesQuery()`. The positive
29
+ query already returned everything. Saves ~38s on osemenitevGoveda, ~14s on
30
+ terapije.
31
+
3
32
  ## 0.1.211 (2026-06-25)
4
33
 
5
34
  ### Added `streamActivityTimeoutMs` to SyncedDbConfig
package/dist/index.js CHANGED
@@ -3333,7 +3333,9 @@ var SyncEngine = class {
3333
3333
  items: items.length,
3334
3334
  itemsCumulative: _perCollectionItems.get(collection),
3335
3335
  isNewCollection: isNewColl,
3336
- processingMs: Math.round(_processingMs)
3336
+ processingMs: Math.round(_processingMs),
3337
+ dexieMs: Math.round(stats.dexieMs),
3338
+ inMemMs: Math.round(stats.inMemMs)
3337
3339
  });
3338
3340
  },
3339
3341
  {
@@ -251,6 +251,8 @@ export interface SyncEngineCallbacks {
251
251
  itemsCumulative?: number;
252
252
  isNewCollection?: boolean;
253
253
  processingMs?: number;
254
+ dexieMs?: number;
255
+ inMemMs?: number;
254
256
  }) => void;
255
257
  onServerSyncStart?: (info: {
256
258
  calledFrom?: string;
@@ -680,8 +680,12 @@ export interface SyncedDbConfig {
680
680
  itemsCumulative?: number;
681
681
  /** True only for the first chunk of a new collection */
682
682
  isNewCollection?: boolean;
683
- /** Processing time for this chunk: Dexie save + InMem write (ms) */
683
+ /** Total processing time for this chunk (ms) */
684
684
  processingMs?: number;
685
+ /** Dexie (IndexedDB) write time for this chunk (ms) */
686
+ dexieMs?: number;
687
+ /** InMem (Vuex/dbx) write time for this chunk (ms) */
688
+ inMemMs?: number;
685
689
  }) => void;
686
690
  /**
687
691
  * Callback when per-collection hydration status changes (hydration end,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cry-synced-db-client",
3
- "version": "0.1.214",
3
+ "version": "0.1.216",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",