Skip to content

docs: reflect signal store locking changes from whatsapp-rust#1226 - #482

Merged
jlucaso1 merged 2 commits into
mainfrom
docs/pr-1226-signal-lock-scoping
Aug 7, 2026
Merged

docs: reflect signal store locking changes from whatsapp-rust#1226#482
jlucaso1 merged 2 commits into
mainfrom
docs/pr-1226-signal-lock-scoping

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

What changed

oxidezap/whatsapp-rust#1226 moved backend I/O and user scans out of the global Signal cache locks. Among other things, it changed SignalProtocolStoreAdapter::new / SenderKeyAdapter::new to take Arc<PersistenceManager> instead of Arc<RwLock<Device>> — the adapters now call get_device_snapshot() per operation instead of holding a read lock on PersistenceManager's internal device (tokio::sync::RwLock<Device>) for the duration of every Signal store call.

advanced/state-management.mdx's "RwLock Semantics" section documented the old behavior as a specific, factual claim:

Only store-adapter code that needs &mut Device trait access (get_device_arc()) takes a read lock here directly.

That's no longer true — the Signal store adapters are exactly the code that stopped using get_device_arc()'s read lock. This PR updates that sentence to describe the current locking, and links to whatsapp-rust#1226 for the rationale (avoiding a slow backend round-trip on one Signal operation blocking every other Signal operation behind the same lock).

Why

This is a targeted correction, not new documentation: the sentence being edited made a specific claim about which code takes the device read lock, and that claim is now false. No other page in this repo (observability.mdx, metrics.mdx, concepts/storage.mdx, the rest of signal-protocol.mdx) makes a claim this PR falsifies — the change is otherwise internal-only (the touched constructors are pub(crate), not part of the public API), so nothing else needed updating.

changelog/ was intentionally left untouched, per repo convention.


Generated by Claude Code


Summary by cubic

Updated the “RwLock Semantics” docs to match whatsapp-rust#1226: the Signal store adapters now hold Arc<PersistenceManager> and use get_device_snapshot() instead of taking a read lock on device per operation. It also clarifies the write‑preferring tokio::sync::RwLock cascade (a writer arriving mid round‑trip queues behind a held read; later readers then queue behind that writer), and notes that get_device_arc() still exists for &mut Device access.

Written for commit 526898c. Summary will update on new commits.

SignalProtocolStoreAdapter and SenderKeyAdapter no longer take a read
lock on `device` per operation (whatsapp-rust#1226); they hold
Arc<PersistenceManager> and call get_device_snapshot() instead.
@mintlify

mintlify Bot commented Aug 7, 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 Aug 7, 2026, 3:29 PM

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

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jlucaso1, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7b53aa2c-136f-4cc5-8192-5203fb7cc31d

📥 Commits

Reviewing files that changed from the base of the PR and between c69c467 and 526898c.

📒 Files selected for processing (1)
  • advanced/state-management.mdx

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.

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR corrects the state-management documentation to reflect the Signal adapters’ snapshot-based access after whatsapp-rust#1226.

  • Explains that SignalProtocolStoreAdapter and SenderKeyAdapter now use Arc<PersistenceManager> and get_device_snapshot().
  • Documents why removing long-lived device read locks avoids lock contention around slow backend operations.
  • Clarifies that get_device_arc() remains available to callers requiring direct &mut Device trait access.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
advanced/state-management.mdx Updates the RwLock semantics section consistently with the documented snapshot-based state model; no eligible follow-up issue was identified.

Reviews (2): Last reviewed commit: "docs: precisely describe the write-prefe..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1e8b4354c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread advanced/state-management.mdx Outdated
Codex flagged that "a slow backend round-trip on one Signal operation
no longer queues every other Signal operation behind this lock"
understated the mechanism: tokio::sync::RwLock allows concurrent
readers, so one reader alone can't block another. The cascade in
whatsapp-rust#1226 required a writer (process_command) to arrive
mid-round-trip and queue behind the held read guard, with later
readers then queuing behind that writer. Split into concise sentences
per AGENTS.md style guidance.
@greptile-apps
greptile-apps Bot dismissed their stale review August 7, 2026 15:35

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@cubic-dev-ai cubic-dev-ai 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.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: This is a documentation-only update that corrects an outdated factual claim about locking behavior. The diff is visible and shows no code, configuration, or operational changes. No human judgment on product, security, or architecture is needed.

Re-trigger cubic

@jlucaso1
jlucaso1 merged commit 489300a into main Aug 7, 2026
4 checks passed
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