-
Notifications
You must be signed in to change notification settings - Fork 0
docs(receiving-messages): PDO's once-per-message gate is per sender #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -620,6 +620,8 @@ PDO is also used alongside retry receipts for normal decryption failures. On the | |
| PDO requests are deduplicated — if a request is already pending for a given message, subsequent requests are skipped. Pending requests expire after 30 seconds. The deduplication cache uses phone-number JIDs as keys (not LID JIDs) to ensure the cache key matches the JID format in the phone's response. | ||
| </Note> | ||
|
|
||
| Separately from that 30-second in-flight cache, the client also gates placeholder requests for a message's whole session lifetime, so a redelivered `<unavailable>` stanza never asks the phone twice. **That once-per-message gate is keyed per sender, not just per `(chat, id)` ([#1319](https://github.com/oxidezap/whatsapp-rust/pull/1319)).** A message ID is chosen by the sending client, not the server, so two different participants in a group can pick the same one; gating on `(chat, id)` alone let the first participant's request silently suppress the second's, which then never got its content recovered. When a PDO response arrives, the client also checks that the pending request it matches actually names the same sender (comparing both the LID and phone-number spellings, since a group's own delivery may carry either) before trusting it — otherwise it rebuilds the recovered message from the response itself rather than risk dispatching it under the wrong sender's identity. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This paragraph violates the repository's AGENTS.md reference: AGENTS.md:L24-L25 Useful? React with 👍 / 👎.
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Rewrite the added paragraph in second person. Line 623 uses third-person actors such as As per coding guidelines, 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| ### Sent message retry (outbound) | ||
|
|
||
| When a recipient's device cannot decrypt your message, it sends a retry receipt. The client handles this automatically using DB-backed sent message storage: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
pdo_requestedgate does not last for the whole session or guarantee that a redelivery never requests the message twice. The documented cache contract is a 24-hour TTL with a 512-entry capacity (changelog/2026-06-11-pdo-once-per-message.mdx:12), so an expired or evicted entry allows another request during the same session. Describe this as a bounded memo cache, including expiration and eviction, rather than a session-lifetime gate.Useful? React with 👍 / 👎.