fix(inbox): a failed PUT no longer lets the next message overtake it (4.13.1)
Some checks failed
Docker build and publish / docker (push) Has been cancelled
Publish / publish (push) Has been cancelled
Cross-platform vectors / TypeScript vectors (bun) (push) Has been cancelled
Cross-platform vectors / Kotlin vectors (gradle) (push) Has been cancelled
Test / test (push) Has been cancelled

flushOnce drained a recipient's bucket in order but carried on past a
failure, delivering N+1 before N's retry. For sender-key broadcasts the
receiver cannot open N once past it — frozen terminal output in Prism.
Stop the bucket at the first failure; other recipients still drain in
parallel. Also corrects senderKeyDecrypt's doc, which claimed a
skipped-key cache that never existed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-06 09:08:52 +02:00
parent f6e4ac8aeb
commit 5d04e18482
30 changed files with 113 additions and 28 deletions

View File

@@ -409,7 +409,17 @@ export class Inbox {
});
if (attempts >= this.maxAttempts) {
await this.queueStore.remove(entry.recipientAddress, entry.msgId);
// Given up on: it no longer holds a place in the order.
continue;
}
// Head-of-line, on purpose. Carrying on with the next entry
// delivers it AHEAD of this one, which is retried next round —
// exactly the reordering the sequential bucket exists to
// prevent. For sender-key broadcasts that is not cosmetic: a
// receiver that sees iteration N+1 first can no longer open N
// unless it kept N's key. One recipient's bucket waits; the
// others drain in parallel as before.
break;
}
}
return count;