cry-synced-db-client 0.1.84 → 0.1.93

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2866,7 +2866,7 @@ var _SyncEngine = class _SyncEngine {
2866
2866
  // Private: Process Incoming Data
2867
2867
  // ============================================================
2868
2868
  /** Max items to process per batch in processIncomingServerData */
2869
- _SyncEngine.SYNC_BATCH_SIZE = 200;
2869
+ _SyncEngine.SYNC_BATCH_SIZE = 2e3;
2870
2870
  var SyncEngine = _SyncEngine;
2871
2871
 
2872
2872
  // src/db/sync/ServerUpdateHandler.ts
@@ -3909,12 +3909,12 @@ var SyncedDb = class _SyncedDb {
3909
3909
  }
3910
3910
  // ==================== Write Operations ====================
3911
3911
  async save(collection, id, update) {
3912
- var _a;
3912
+ var _a, _b;
3913
3913
  this.assertCollection(collection);
3914
3914
  id = this.normalizeId(id);
3915
3915
  update = _SyncedDb.stringifyObjectIds(update);
3916
3916
  const existing = await this.dexieDb.getById(collection, id);
3917
- if (!existing) {
3917
+ if (!existing && !((_a = this.collections.get(collection)) == null ? void 0 : _a.writeOnly)) {
3918
3918
  console.warn(
3919
3919
  `SyncedDb.save: Object ${String(id)} not found in ${collection}, creating new`
3920
3920
  );
@@ -3929,7 +3929,7 @@ var SyncedDb = class _SyncedDb {
3929
3929
  _lastUpdaterId: this.updaterId
3930
3930
  });
3931
3931
  this.pendingChanges.schedule(collection, id, newData, 0, "save");
3932
- const isWriteOnly = (_a = this.collections.get(collection)) == null ? void 0 : _a.writeOnly;
3932
+ const isWriteOnly = (_b = this.collections.get(collection)) == null ? void 0 : _b.writeOnly;
3933
3933
  const currentMem = isWriteOnly ? null : this.inMemDb.getById(collection, id);
3934
3934
  const merged = __spreadValues(__spreadValues({}, currentMem || existing || { _id: id }), update);
3935
3935
  if (!isWriteOnly && !(existing == null ? void 0 : existing._deleted) && !(existing == null ? void 0 : existing._archived)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cry-synced-db-client",
3
- "version": "0.1.84",
3
+ "version": "0.1.93",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "cry-db": "^2.4.23",
39
39
  "cry-helpers": "^2.1.193",
40
- "cry-synced-db-client": "0.1.83",
40
+ "cry-synced-db-client": "0.1.84",
41
41
  "msgpackr": "^1.11.9",
42
42
  "notepack": "^0.0.2",
43
43
  "notepack.io": "^3.0.1",