cry-synced-db-client 0.1.201 → 0.1.202
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 +22 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6700,14 +6700,29 @@ var _SyncedDb = class _SyncedDb {
|
|
|
6700
6700
|
const metas = await this.dexieDb.getDirtyMeta(collectionName);
|
|
6701
6701
|
const stuck = metas.filter((m) => m.stuckSince !== void 0);
|
|
6702
6702
|
if (stuck.length === 0) continue;
|
|
6703
|
-
const
|
|
6704
|
-
const changesMap = await this.dexieDb.getDirtyChangesBatch(
|
|
6705
|
-
collectionName,
|
|
6706
|
-
stuckIds
|
|
6707
|
-
);
|
|
6703
|
+
const allDirty = await this.dexieDb.getDirty(collectionName);
|
|
6708
6704
|
const content = stuck.map((m) => {
|
|
6709
|
-
const
|
|
6710
|
-
|
|
6705
|
+
const dirtyId = String(m.id);
|
|
6706
|
+
const found = allDirty.find(
|
|
6707
|
+
(d) => String(d._id) === dirtyId
|
|
6708
|
+
);
|
|
6709
|
+
if (found) {
|
|
6710
|
+
const _a = found, { _id, _ts, _rev } = _a, changedFields = __objRest(_a, ["_id", "_ts", "_rev"]);
|
|
6711
|
+
return {
|
|
6712
|
+
collection: collectionName,
|
|
6713
|
+
id: dirtyId,
|
|
6714
|
+
changes: changedFields,
|
|
6715
|
+
baseTs: _ts,
|
|
6716
|
+
baseRev: _rev,
|
|
6717
|
+
createdAt: m.createdAt,
|
|
6718
|
+
updatedAt: m.updatedAt,
|
|
6719
|
+
firstUploadAttempt: m.firstUploadAttempt,
|
|
6720
|
+
lastUploadAttempt: m.lastUploadAttempt,
|
|
6721
|
+
numUploadAttempts: m.numUploadAttempts,
|
|
6722
|
+
stuckSince: m.stuckSince
|
|
6723
|
+
};
|
|
6724
|
+
}
|
|
6725
|
+
return __spreadProps(__spreadValues({}, m), { changes: {} });
|
|
6711
6726
|
});
|
|
6712
6727
|
this.safeCallback(this.onBeforeDirtyClearAll, {
|
|
6713
6728
|
reason: "discard-stuck",
|