@dxos/echo-pipeline 0.6.3-main.9e4e207 → 0.6.3-main.b88405e
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/lib/browser/{chunk-PEE7MYCZ.mjs → chunk-HYHMFP7V.mjs} +35 -10
- package/dist/lib/browser/chunk-HYHMFP7V.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-RLTLWNAY.cjs → chunk-OS6SQAWQ.cjs} +38 -13
- package/dist/lib/node/chunk-OS6SQAWQ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +34 -34
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +11 -11
- package/dist/types/src/db-host/documents-synchronizer.d.ts +1 -1
- package/dist/types/src/db-host/documents-synchronizer.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/automerge/automerge-host.ts +2 -2
- package/src/db-host/documents-synchronizer.ts +17 -5
- package/dist/lib/browser/chunk-PEE7MYCZ.mjs.map +0 -7
- package/dist/lib/node/chunk-RLTLWNAY.cjs.map +0 -7
|
@@ -137,14 +137,39 @@ var DocumentsSynchronizer = class extends Resource {
|
|
|
137
137
|
this._pendingUpdates = /* @__PURE__ */ new Set();
|
|
138
138
|
this._sendUpdatesJob = void 0;
|
|
139
139
|
}
|
|
140
|
-
|
|
140
|
+
addDocuments(documentIds, retryCounter = 0) {
|
|
141
|
+
if (retryCounter > 3) {
|
|
142
|
+
log.warn("Failed to load document, retry limit reached", {
|
|
143
|
+
documentIds
|
|
144
|
+
}, {
|
|
145
|
+
F: __dxlog_file2,
|
|
146
|
+
L: 49,
|
|
147
|
+
S: this,
|
|
148
|
+
C: (f, a) => f(...a)
|
|
149
|
+
});
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
141
152
|
for (const documentId of documentIds) {
|
|
142
153
|
const doc = this._params.repo.find(documentId);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
154
|
+
doc.whenReady().then(() => {
|
|
155
|
+
this._startSync(doc);
|
|
156
|
+
this._pendingUpdates.add(doc.documentId);
|
|
157
|
+
this._sendUpdatesJob.trigger();
|
|
158
|
+
}).catch((error) => {
|
|
159
|
+
log.warn("Failed to load document, wraparound", {
|
|
160
|
+
documentId,
|
|
161
|
+
error
|
|
162
|
+
}, {
|
|
163
|
+
F: __dxlog_file2,
|
|
164
|
+
L: 63,
|
|
165
|
+
S: this,
|
|
166
|
+
C: (f, a) => f(...a)
|
|
167
|
+
});
|
|
168
|
+
this.addDocuments([
|
|
169
|
+
documentId
|
|
170
|
+
], retryCounter + 1);
|
|
171
|
+
});
|
|
146
172
|
}
|
|
147
|
-
this._sendUpdatesJob.trigger();
|
|
148
173
|
}
|
|
149
174
|
removeDocuments(documentIds) {
|
|
150
175
|
for (const documentId of documentIds) {
|
|
@@ -179,7 +204,7 @@ var DocumentsSynchronizer = class extends Resource {
|
|
|
179
204
|
documentId: doc.documentId
|
|
180
205
|
}, {
|
|
181
206
|
F: __dxlog_file2,
|
|
182
|
-
L:
|
|
207
|
+
L: 102,
|
|
183
208
|
S: this,
|
|
184
209
|
C: (f, a) => f(...a)
|
|
185
210
|
});
|
|
@@ -222,7 +247,7 @@ var DocumentsSynchronizer = class extends Resource {
|
|
|
222
247
|
const syncState = this._syncStates.get(documentId);
|
|
223
248
|
invariant2(syncState, "Sync state for document not found", {
|
|
224
249
|
F: __dxlog_file2,
|
|
225
|
-
L:
|
|
250
|
+
L: 143,
|
|
226
251
|
S: this,
|
|
227
252
|
A: [
|
|
228
253
|
"syncState",
|
|
@@ -244,7 +269,7 @@ var DocumentsSynchronizer = class extends Resource {
|
|
|
244
269
|
const syncState = this._syncStates.get(documentId);
|
|
245
270
|
invariant2(syncState, "Sync state for document not found", {
|
|
246
271
|
F: __dxlog_file2,
|
|
247
|
-
L:
|
|
272
|
+
L: 158,
|
|
248
273
|
S: this,
|
|
249
274
|
A: [
|
|
250
275
|
"syncState",
|
|
@@ -1024,7 +1049,7 @@ var AutomergeHost = class extends Resource4 {
|
|
|
1024
1049
|
await waitForHeads(handle, entry.heads);
|
|
1025
1050
|
}));
|
|
1026
1051
|
}
|
|
1027
|
-
await this._repo.flush(
|
|
1052
|
+
await this._repo.flush(documentIds.filter((documentId) => !!this._repo.handles[documentId]));
|
|
1028
1053
|
}
|
|
1029
1054
|
async reIndexHeads(documentIds) {
|
|
1030
1055
|
for (const documentId of documentIds) {
|
|
@@ -3841,4 +3866,4 @@ export {
|
|
|
3841
3866
|
MetadataStore,
|
|
3842
3867
|
hasInvitationExpired
|
|
3843
3868
|
};
|
|
3844
|
-
//# sourceMappingURL=chunk-
|
|
3869
|
+
//# sourceMappingURL=chunk-HYHMFP7V.mjs.map
|