@dxos/echo-pipeline 0.6.3-main.cc41ccb → 0.6.3-main.daaea86
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-HYHMFP7V.mjs → chunk-PEE7MYCZ.mjs} +10 -35
- package/dist/lib/browser/chunk-PEE7MYCZ.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-OS6SQAWQ.cjs → chunk-RLTLWNAY.cjs} +13 -38
- package/dist/lib/node/chunk-RLTLWNAY.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 +5 -17
- package/dist/lib/browser/chunk-HYHMFP7V.mjs.map +0 -7
- package/dist/lib/node/chunk-OS6SQAWQ.cjs.map +0 -7
|
@@ -137,39 +137,14 @@ var DocumentsSynchronizer = class extends Resource {
|
|
|
137
137
|
this._pendingUpdates = /* @__PURE__ */ new Set();
|
|
138
138
|
this._sendUpdatesJob = void 0;
|
|
139
139
|
}
|
|
140
|
-
addDocuments(documentIds
|
|
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
|
-
}
|
|
140
|
+
async addDocuments(documentIds) {
|
|
152
141
|
for (const documentId of documentIds) {
|
|
153
142
|
const doc = this._params.repo.find(documentId);
|
|
154
|
-
doc.whenReady()
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
});
|
|
143
|
+
await doc.whenReady();
|
|
144
|
+
this._startSync(doc);
|
|
145
|
+
this._pendingUpdates.add(doc.documentId);
|
|
172
146
|
}
|
|
147
|
+
this._sendUpdatesJob.trigger();
|
|
173
148
|
}
|
|
174
149
|
removeDocuments(documentIds) {
|
|
175
150
|
for (const documentId of documentIds) {
|
|
@@ -204,7 +179,7 @@ var DocumentsSynchronizer = class extends Resource {
|
|
|
204
179
|
documentId: doc.documentId
|
|
205
180
|
}, {
|
|
206
181
|
F: __dxlog_file2,
|
|
207
|
-
L:
|
|
182
|
+
L: 90,
|
|
208
183
|
S: this,
|
|
209
184
|
C: (f, a) => f(...a)
|
|
210
185
|
});
|
|
@@ -247,7 +222,7 @@ var DocumentsSynchronizer = class extends Resource {
|
|
|
247
222
|
const syncState = this._syncStates.get(documentId);
|
|
248
223
|
invariant2(syncState, "Sync state for document not found", {
|
|
249
224
|
F: __dxlog_file2,
|
|
250
|
-
L:
|
|
225
|
+
L: 131,
|
|
251
226
|
S: this,
|
|
252
227
|
A: [
|
|
253
228
|
"syncState",
|
|
@@ -269,7 +244,7 @@ var DocumentsSynchronizer = class extends Resource {
|
|
|
269
244
|
const syncState = this._syncStates.get(documentId);
|
|
270
245
|
invariant2(syncState, "Sync state for document not found", {
|
|
271
246
|
F: __dxlog_file2,
|
|
272
|
-
L:
|
|
247
|
+
L: 146,
|
|
273
248
|
S: this,
|
|
274
249
|
A: [
|
|
275
250
|
"syncState",
|
|
@@ -1049,7 +1024,7 @@ var AutomergeHost = class extends Resource4 {
|
|
|
1049
1024
|
await waitForHeads(handle, entry.heads);
|
|
1050
1025
|
}));
|
|
1051
1026
|
}
|
|
1052
|
-
await this._repo.flush(
|
|
1027
|
+
await this._repo.flush(heads.entries?.map((entry) => entry.documentId) ?? []);
|
|
1053
1028
|
}
|
|
1054
1029
|
async reIndexHeads(documentIds) {
|
|
1055
1030
|
for (const documentId of documentIds) {
|
|
@@ -3866,4 +3841,4 @@ export {
|
|
|
3866
3841
|
MetadataStore,
|
|
3867
3842
|
hasInvitationExpired
|
|
3868
3843
|
};
|
|
3869
|
-
//# sourceMappingURL=chunk-
|
|
3844
|
+
//# sourceMappingURL=chunk-PEE7MYCZ.mjs.map
|