cry-synced-db-client 0.1.83 → 0.1.84

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 +9 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1970,9 +1970,9 @@ var PendingChangesManager = class {
1970
1970
  if (existing) {
1971
1971
  clearTimeout(existing.timer);
1972
1972
  }
1973
- const deltaWithId = existing ? data : __spreadValues({ _id: id }, data);
1973
+ const deltaWithId = existing ? data : __spreadProps(__spreadValues({}, data), { _id: id });
1974
1974
  savePendingWrite(this.tenant, collection, id, deltaWithId);
1975
- const fullData = existing ? Object.assign(existing.data, data) : __spreadValues({ _id: id }, data);
1975
+ const fullData = existing ? Object.assign(existing.data, data, { _id: id }) : __spreadProps(__spreadValues({}, data), { _id: id });
1976
1976
  const timer = setTimeout(() => {
1977
1977
  this.executePendingChange(key);
1978
1978
  }, this.debounceDexieWritesMs);
@@ -2144,9 +2144,14 @@ var PendingChangesManager = class {
2144
2144
  pending.data
2145
2145
  );
2146
2146
  } else {
2147
- await this.deps.dexieDb.insert(pending.collection, __spreadValues({
2147
+ const insertData = __spreadProps(__spreadValues({}, pending.data), {
2148
2148
  _id: pending.id
2149
- }, pending.data));
2149
+ // ensure _id is after spread
2150
+ });
2151
+ if (typeof insertData._id === "object") {
2152
+ console.error(`Dexie: _id is object type in ${pending.collection}:`, typeof insertData._id, insertData._id);
2153
+ }
2154
+ await this.deps.dexieDb.insert(pending.collection, insertData);
2150
2155
  }
2151
2156
  if (this.callbacks.onDexieWriteResult) {
2152
2157
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cry-synced-db-client",
3
- "version": "0.1.83",
3
+ "version": "0.1.84",
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.81",
40
+ "cry-synced-db-client": "0.1.83",
41
41
  "msgpackr": "^1.11.9",
42
42
  "notepack": "^0.0.2",
43
43
  "notepack.io": "^3.0.1",