cry-synced-db-client 2.0.0 → 2.0.1
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/dist/index.js +8 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4512,7 +4512,7 @@ var ServerUpdateHandler = class {
|
|
|
4512
4512
|
return updatedIds;
|
|
4513
4513
|
}
|
|
4514
4514
|
async processBracketedItem(collection, item) {
|
|
4515
|
-
var _a, _b, _c, _d, _e, _f;
|
|
4515
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4516
4516
|
const localItem = await this.dexieDb.getById(collection, item._id);
|
|
4517
4517
|
if (!localItem) {
|
|
4518
4518
|
if (item.operation === "insert" && item.bracketedData) {
|
|
@@ -4529,8 +4529,7 @@ var ServerUpdateHandler = class {
|
|
|
4529
4529
|
const revAction = this.checkRev(
|
|
4530
4530
|
item._rev,
|
|
4531
4531
|
item._ts,
|
|
4532
|
-
void 0,
|
|
4533
|
-
// bracketedData doesn't carry _lastUpdaterId
|
|
4532
|
+
(_b = item._lastUpdaterId) != null ? _b : (_a = item.bracketedData) == null ? void 0 : _a._lastUpdaterId,
|
|
4534
4533
|
localItem
|
|
4535
4534
|
);
|
|
4536
4535
|
switch (revAction) {
|
|
@@ -4559,8 +4558,8 @@ var ServerUpdateHandler = class {
|
|
|
4559
4558
|
this.callOnEbusUpdateSkipped({
|
|
4560
4559
|
collection,
|
|
4561
4560
|
_id: item._id,
|
|
4562
|
-
incomingRev: (
|
|
4563
|
-
localRev: (
|
|
4561
|
+
incomingRev: (_c = item._rev) != null ? _c : 0,
|
|
4562
|
+
localRev: (_d = localItem._rev) != null ? _d : 0,
|
|
4564
4563
|
reason: "fetch-failed"
|
|
4565
4564
|
});
|
|
4566
4565
|
return false;
|
|
@@ -4573,8 +4572,8 @@ var ServerUpdateHandler = class {
|
|
|
4573
4572
|
const diff = this.stripMetaFromDiff(item.bracketedData);
|
|
4574
4573
|
const currentInMemState = Object.assign({}, localItem, pendingChange.data);
|
|
4575
4574
|
const merged = applyObjDiff(currentInMemState, diff, item._id, "bracketed");
|
|
4576
|
-
merged._rev = (
|
|
4577
|
-
merged._ts = (
|
|
4575
|
+
merged._rev = (_e = item._rev) != null ? _e : localItem._rev;
|
|
4576
|
+
merged._ts = (_f = item._ts) != null ? _f : localItem._ts;
|
|
4578
4577
|
if (!merged._deleted && !merged._archived) {
|
|
4579
4578
|
this.deps.writeToInMemBatch(collection, [this.stripLocalFields(merged)], "upsert", {
|
|
4580
4579
|
source: "incremental"
|
|
@@ -4586,8 +4585,8 @@ var ServerUpdateHandler = class {
|
|
|
4586
4585
|
if (dirtyChange && item.operation === "update") {
|
|
4587
4586
|
const diff = this.stripMetaFromDiff(item.bracketedData);
|
|
4588
4587
|
const merged = applyObjDiff(localItem, diff, item._id, "bracketed");
|
|
4589
|
-
merged._rev = (
|
|
4590
|
-
merged._ts = (
|
|
4588
|
+
merged._rev = (_g = item._rev) != null ? _g : localItem._rev;
|
|
4589
|
+
merged._ts = (_h = item._ts) != null ? _h : localItem._ts;
|
|
4591
4590
|
if (!merged._deleted && !merged._archived) {
|
|
4592
4591
|
await this.dexieDb.insert(collection, merged);
|
|
4593
4592
|
this.deps.writeToInMemBatch(collection, [this.stripLocalFields(merged)], "upsert", {
|