@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.
@@ -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, 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
- }
140
+ async addDocuments(documentIds) {
152
141
  for (const documentId of documentIds) {
153
142
  const doc = this._params.repo.find(documentId);
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
- });
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: 102,
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: 143,
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: 158,
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(documentIds.filter((documentId) => !!this._repo.handles[documentId]));
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-HYHMFP7V.mjs.map
3844
+ //# sourceMappingURL=chunk-PEE7MYCZ.mjs.map