-
Notifications
You must be signed in to change notification settings - Fork 0
docs: Signal-cache flush scheduling and flush_pending_signal_state (PR #1022) #402
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 6 commits
9be80e3
a2aa96a
f73a93f
b9f6fa8
587fb6b
83bd0eb
e186d7d
4256898
7d780c2
c0f54e0
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,6 +43,10 @@ pub async fn send_message( | |||||||||||||
| Contains the `message_id` (unique ID for tracking receipts, edits, revokes) and `to` (resolved recipient JID). Use `send_result.message_key()` to get a `wa::MessageKey` for album child linking, pinning, or other operations that reference this message. | ||||||||||||||
| </ResponseField> | ||||||||||||||
|
|
||||||||||||||
| <Note> | ||||||||||||||
| For DMs, group, and status sends, the outbound Signal ratchet advance is persisted to the backend **synchronously, before the stanza is transmitted** — reusing an outbound counter would reuse its message key and IV, so the advance must be durable before anyone can act on the ciphertext. If that persistence write fails, `send_message` returns `Err` instead of transmitting an advance that couldn't be saved. See [Signal Protocol — flush scheduling](/advanced/signal-protocol#flush-scheduling-send-vs-receive) for the full durability model. | ||||||||||||||
| </Note> | ||||||||||||||
|
Comment on lines
+46
to
+48
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 Use concise sentences and active voice. The note merges multiple ideas into a single long sentence and uses passive voice ("is persisted"). As per coding guidelines, documentation must use concise sentences (one idea per sentence) and active voice. 📝 Proposed rewrite <Note>
-For DMs, group, and status sends, the outbound Signal ratchet advance is persisted to the backend **synchronously, before the stanza is transmitted** — reusing an outbound counter would reuse its message key and IV, so the advance must be durable before anyone can act on the ciphertext. If that persistence write fails, `send_message` returns `Err` instead of transmitting an advance that couldn't be saved. See [Signal Protocol — flush scheduling](/advanced/signal-protocol#flush-scheduling-send-vs-receive) for the full durability model.
+For DMs, group, and status sends, the client persists the outbound Signal ratchet advance to the backend **synchronously, before the stanza is transmitted**. Reusing an outbound counter would reuse its message key and IV. Therefore, the advance must be durable before anyone can act on the ciphertext. If that persistence write fails, `send_message` returns `Err` instead of transmitting an advance that it could not save. See [Signal Protocol — flush scheduling](/advanced/signal-protocol#flush-scheduling-send-vs-receive) for the full durability model.
</Note>📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||
|
|
||||||||||||||
| ### SendResult | ||||||||||||||
|
|
||||||||||||||
| Result of a successfully sent message. Provides the message ID and a convenience method to construct a `MessageKey` for follow-up operations like album child linking. | ||||||||||||||
|
|
@@ -1252,7 +1256,7 @@ pub enum SendError { | |||||||||||||
| - `Iq` — IQ request required by the send path failed | ||||||||||||||
| - `InvalidRequest` — the send request was malformed (e.g., invalid JID, bad message shape) | ||||||||||||||
| - `Client` — underlying transport/connection error | ||||||||||||||
| - `Internal` — catch-all for errors not yet assigned a typed variant | ||||||||||||||
| - `Internal` — catch-all for errors not yet assigned a typed variant. Includes a failure to durably persist the outbound Signal ratchet advance before the stanza was sent — see the durability note under [`send_message`](#send_message). | ||||||||||||||
|
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 Use concise sentences. The description merges two separate directives with an em dash. As per coding guidelines, documentation must use concise sentences with one idea per sentence. 📝 Proposed rewrite-- `Internal` — catch-all for errors not yet assigned a typed variant. Includes a failure to durably persist the outbound Signal ratchet advance before the stanza was sent — see the durability note under [`send_message`](`#send_message`).
+- `Internal` — catch-all for errors not yet assigned a typed variant. It includes a failure to durably persist the outbound Signal ratchet advance before the stanza was sent. See the durability note under [`send_message`](`#send_message`).📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||
|
|
||||||||||||||
| **Example:** | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.