-
Notifications
You must be signed in to change notification settings - Fork 0
docs: changelog for msg_secret semaphore fix (whatsapp-rust#832) #306
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| title: "June 10, 2026 — Fix: msg_secret reads serialized through db semaphore" | ||
| description: "get_msg_secret and get_msg_secret_with_ts now route through with_semaphore, preventing silent decryption failures on in-memory stores when a read races a write." | ||
| --- | ||
|
|
||
| ## Bug fixes | ||
|
|
||
| **SQLite store: serialize `msg_secret` reads through the db semaphore ([#832](https://github.com/oxidezap/whatsapp-rust/pull/832))** | ||
|
|
||
| `get_msg_secret` and `get_msg_secret_with_ts` were dispatched via raw `spawn_blocking`, bypassing the single-permit `db_semaphore` that all write paths (and most other reads) already acquire via `with_semaphore`. On in-memory (`:memory:`) stores a read that overlaps an active write transaction hits the shared-cache table lock and fails with `SQLITE_LOCKED` — an error not covered by `busy_timeout`. Both call sites treat a backend error as a lookup miss, so the failure was silent. | ||
|
|
||
| In practice, the write-behind drain introduced in [#831](https://github.com/oxidezap/whatsapp-rust/pull/831) made this race consistently reachable: the detached batch write could race the very next incoming message's secret lookup. The symptom was encrypted reactions and channel comments (added in [#829](https://github.com/oxidezap/whatsapp-rust/pull/829)) arriving undecrypted, with no error logged. | ||
|
|
||
| Both methods now go through `with_semaphore`. A read that arrives during a write waits for the permit instead of failing as a phantom miss. | ||
|
|
||
| **Affected stores:** in-memory (`:memory:`) SQLite — used by the test suite and any embedded consumer. File-backed stores with WAL mode are not affected (WAL readers do not block on concurrent writers). | ||
|
|
||
| ## Breaking changes | ||
|
|
||
| None. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Rewrite to use active voice and second person per documentation guidelines.
The description uses passive voice and third person, violating the documentation style guidelines. Changelog entries are user-facing documentation and should address the reader directly.
As per coding guidelines, documentation should use active voice and second person ("you"). The guideline text states: "Use active voice and second person ('you') in documentation."
♻️ Suggested rewrite in active voice and second person
🤖 Prompt for AI Agents
Source: Coding guidelines