@docstack/pouchdb-adapter-googledrive 0.1.3 → 0.1.4
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/lib/drive.js +6 -0
- package/package.json +1 -1
package/lib/drive.js
CHANGED
|
@@ -287,6 +287,12 @@ class DriveHandler {
|
|
|
287
287
|
doc = content;
|
|
288
288
|
}
|
|
289
289
|
if (doc) {
|
|
290
|
+
// HEAL: Ensure PouchDB core validation doesn't fail due to history corruption
|
|
291
|
+
// This prevents the infinite replicator retry loop when start < ids.length
|
|
292
|
+
if (doc._revisions && doc._revisions.start < doc._revisions.ids.length) {
|
|
293
|
+
const start = doc._revisions.start || 1;
|
|
294
|
+
doc._revisions.ids = doc._revisions.ids.slice(0, start);
|
|
295
|
+
}
|
|
290
296
|
this.docCache.put(id, doc);
|
|
291
297
|
doc._rev = entry.rev;
|
|
292
298
|
}
|