cry-synced-db-client 0.1.209 → 0.1.210
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 +1 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6462,30 +6462,12 @@ var _SyncedDb = class _SyncedDb {
|
|
|
6462
6462
|
}
|
|
6463
6463
|
this.syncing = true;
|
|
6464
6464
|
this.crossTabSync.startServerSync();
|
|
6465
|
-
let evictionPlan;
|
|
6466
|
-
let evictionServerFailed = false;
|
|
6467
|
-
if (await this._isAutoEvictionDue(calledFrom)) {
|
|
6468
|
-
try {
|
|
6469
|
-
evictionPlan = await this._collectScopeExitPlan("auto");
|
|
6470
|
-
} catch (err) {
|
|
6471
|
-
console.error(
|
|
6472
|
-
"[SyncedDb] [evict] phase 1 failed (skipping bundled eviction):",
|
|
6473
|
-
err
|
|
6474
|
-
);
|
|
6475
|
-
}
|
|
6476
|
-
}
|
|
6477
|
-
const evictionExtras = evictionPlan && evictionPlan.specs.length > 0 ? {
|
|
6478
|
-
specs: evictionPlan.specs,
|
|
6479
|
-
onChunk: (specId, items) => {
|
|
6480
|
-
this._applyScopeExitChunkToPlan(evictionPlan, specId, items);
|
|
6481
|
-
}
|
|
6482
|
-
} : void 0;
|
|
6483
6465
|
const consumingPendingFullResync = this._pendingFullResync;
|
|
6484
6466
|
if (consumingPendingFullResync) {
|
|
6485
6467
|
await this._resetSyncCursors();
|
|
6486
6468
|
}
|
|
6487
6469
|
try {
|
|
6488
|
-
await this.syncEngine.sync(calledFrom
|
|
6470
|
+
await this.syncEngine.sync(calledFrom);
|
|
6489
6471
|
if (!this.syncOnlyCollections) {
|
|
6490
6472
|
const now = /* @__PURE__ */ new Date();
|
|
6491
6473
|
if (!this._lastFullSyncDate) {
|
|
@@ -6505,24 +6487,11 @@ var _SyncedDb = class _SyncedDb {
|
|
|
6505
6487
|
if (consumingPendingFullResync) this._pendingFullResync = false;
|
|
6506
6488
|
}
|
|
6507
6489
|
} catch (err) {
|
|
6508
|
-
if (evictionExtras) evictionServerFailed = true;
|
|
6509
6490
|
throw err;
|
|
6510
6491
|
} finally {
|
|
6511
6492
|
this.syncing = false;
|
|
6512
6493
|
this.crossTabSync.endServerSync();
|
|
6513
6494
|
await this.processQueuedWsUpdates();
|
|
6514
|
-
if (evictionPlan) {
|
|
6515
|
-
try {
|
|
6516
|
-
await this._applyScopeExitPlan(
|
|
6517
|
-
evictionPlan,
|
|
6518
|
-
evictionServerFailed,
|
|
6519
|
-
evictionExtras ? 1 : 0
|
|
6520
|
-
);
|
|
6521
|
-
await this._persistEvictionTimestamp();
|
|
6522
|
-
} catch (err) {
|
|
6523
|
-
console.error(`[SyncedDb] [evict] phase 3 failed: ${err}`, err);
|
|
6524
|
-
}
|
|
6525
|
-
}
|
|
6526
6495
|
}
|
|
6527
6496
|
} finally {
|
|
6528
6497
|
this.syncLock = false;
|