libp2r2p 0.11.1 → 0.11.2
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/package.json
CHANGED
|
@@ -324,7 +324,11 @@ export function createPrivateFileTransfer ({ messenger, resolveChannel, storage,
|
|
|
324
324
|
await sub.ready
|
|
325
325
|
signal.throwIfAborted()
|
|
326
326
|
// Partial/failed history still permits recovery from peers.
|
|
327
|
-
const history = _transport.fetch({ ...options, signal: AbortSignal.any([signal, historyController.signal]), since: 0 }).catch(error => {
|
|
327
|
+
const history = _transport.fetch({ ...options, signal: AbortSignal.any([signal, historyController.signal]), since: 0 }).catch(error => {
|
|
328
|
+
// Completion aborts the remaining history read in finally. Only its
|
|
329
|
+
// own cancellation is expected; genuine history failures stay visible.
|
|
330
|
+
if (!signal.aborted && !(historyController.signal.aborted && error === historyController.signal.reason)) onError(error)
|
|
331
|
+
})
|
|
328
332
|
work.add(history); history.finally(() => work.delete(history))
|
|
329
333
|
const seeders = [...validSeeders].sort((a, b) => (successes.get(b) || 0) - (successes.get(a) || 0) || Math.random() - 0.5)
|
|
330
334
|
while (true) {
|