Skip to content

docs: changelog for signal cache flush lock-contention fix (whatsapp-rust#888) - #344

Closed
jlucaso1 wants to merge 2 commits into
mainfrom
claude/eager-cerf-814ka2
Closed

docs: changelog for signal cache flush lock-contention fix (whatsapp-rust#888)#344
jlucaso1 wants to merge 2 commits into
mainfrom
claude/eager-cerf-814ka2

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary\n\nAdds a changelog entry for whatsapp-rust#888 — a performance fix that eliminates Device read↔write lock contention on the per-message hot path.\n\nWhat changed in the library:\nflush_signal_cache previously held the Device read() guard across the full signal_cache.flush(...) call (a batched SQLite write). It now clones the backend Arc from get_device_snapshot() and drops the guard before flushing, so no device lock is held during I/O. No API or behavior change.\n\n## Files changed\n\n- changelog/2026-06-18-flush-signal-cache-readlock.mdx — new changelog entry\n- docs.json — registers the new page at the top of the Changelog tab\n\n## Test plan\n\n- [ ] Mintlify renders the new changelog page without errors\n- [ ] Entry appears at the top of the Changelog list (above June 15)\n- [ ] No other pages affected


Generated by Claude Code


Summary by cubic

Adds a changelog entry for whatsapp-rust#888 documenting the flush_signal_cache performance fix: clone the backend Arc from get_device_snapshot() and drop the Device read lock before the batched SQLite write to remove read↔write lock contention. Updates docs.json to surface the new page at the top of the Changelog and refines the entry wording for clarity.

Written for commit c1e5a0c. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Optimized internal performance by reducing lock contention in signal cache operations.
  • Documentation

    • Added changelog entry documenting recent performance improvements.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a changelog entry (2026-06-18-flush-signal-cache-readlock.mdx) documenting that flush_signal_cache now clones the backend Arc before the batched SQLite write to release the Device read guard early, and registers the new page in docs.json.

Changes

Changelog: flush_signal_cache read lock fix

Layer / File(s) Summary
Changelog entry and nav registration
changelog/2026-06-18-flush-signal-cache-readlock.mdx, docs.json
New MDX page documents the flush_signal_cache read↔write lock contention fix; docs.json inserts the corresponding slug into the Changelog navigation array.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 A lock held too long, a guard in the way,
The rabbit cloned Arc and hopped on its way.
No contention at write, the cache flushes free,
A changelog was penned for all readers to see.
No breakage, no fuss — just fast as can be! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a changelog entry for a signal cache flush lock-contention performance fix from whatsapp-rust#888.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/eager-cerf-814ka2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mintlify

mintlify Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
whatsapp-rust 🟢 Ready View Preview Jun 18, 2026, 2:13 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
changelog/2026-06-18-flush-signal-cache-readlock.mdx (1)

10-10: ⚡ Quick win

Simplify sentence structure to follow the one-idea-per-sentence guideline.

Line 10 combines multiple ideas in single sentences. Per the coding guideline for **/*.{md,mdx} files, keep sentences concise with one idea per sentence. The second sentence mixes the consequence (blocking) with the cause (lock contention). Breaking these into separate, focused sentences improves clarity.

♻️ Proposed refactoring to simplify sentence structure
  `flush_signal_cache` runs once per decrypted message and on most outgoing sends. Previously it called `get_device_arc().read()` and held the resulting read guard across the entire `signal_cache.flush(...)` call — a batched SQLite write. Any concurrent `modify_device` or `process_command` (both of which require a Device write lock) would block for the full flush duration, creating read↔write lock contention on the per-message hot path.
+ `flush_signal_cache` runs once per decrypted message and on most outgoing sends. Previously, it called `get_device_arc().read()` and held the read guard across the entire `signal_cache.flush(...)` call — a batched SQLite write. Any concurrent `modify_device` or `process_command` operations require a Device write lock and would block for the full flush duration. This created read↔write lock contention on the per-message hot path.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@changelog/2026-06-18-flush-signal-cache-readlock.mdx` at line 10, The second
sentence in the diff starting with "Any concurrent" combines multiple ideas (the
blocking behavior and the read-write contention consequence) in a single
sentence, violating the one-idea-per-sentence guideline for markdown files.
Break this sentence into separate, focused sentences by first stating what
operations would block and why, then in a separate sentence explaining the
consequence of this blocking (the contention on the hot path). Each sentence
should address a single concept or idea to improve clarity and readability.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@changelog/2026-06-18-flush-signal-cache-readlock.mdx`:
- Line 10: The second sentence in the diff starting with "Any concurrent"
combines multiple ideas (the blocking behavior and the read-write contention
consequence) in a single sentence, violating the one-idea-per-sentence guideline
for markdown files. Break this sentence into separate, focused sentences by
first stating what operations would block and why, then in a separate sentence
explaining the consequence of this blocking (the contention on the hot path).
Each sentence should address a single concept or idea to improve clarity and
readability.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d6fdcdfb-bc3d-4ddc-9e11-1024f22c0f3d

📥 Commits

Reviewing files that changed from the base of the PR and between 9232593 and 7149797.

📒 Files selected for processing (2)
  • changelog/2026-06-18-flush-signal-cache-readlock.mdx
  • docs.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant