Skip to content

docs(signal-protocol): document counter-lease waiver opt-out - #475

Merged
jlucaso1 merged 3 commits into
mainfrom
claude/nifty-bohr-5k1z5l
Aug 5, 2026
Merged

docs(signal-protocol): document counter-lease waiver opt-out#475
jlucaso1 merged 3 commits into
mainfrom
claude/nifty-bohr-5k1z5l

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Documents the counter-lease opt-out added in oxidezap/whatsapp-rust#1211: SessionRecord::waive_counter_lease() and SenderKeyRecord::waive_counter_lease().
  • Adds a new Waiving the counter lease subsection to advanced/signal-protocol.mdx, right after the existing counter-lease/rebase documentation and before Record components — the section describing the component-export use case this API exists for.
  • Covers: what the waiver does, the durability trade-off it makes, that policy is per-record and never inferred from the stored representation, how a pre-existing reservation still materializes once, and the differing fail-closed-vs-Err behavior between SessionRecord and SenderKeyRecord.
  • Cross-links the new subsection from the Record components intro, since a components-only store is exactly the consumer this API is for.

Why

whatsapp-rust#1211 explains that a consumer whose persistence is a component export gets nothing from the batched counter lease (it's already durable before the wire) but previously paid for it anyway — into_components() had to materialize a full 64-counter reservation on every export, so four consecutive DM sends landed on the wire at counters 0, 64, 128, 192 instead of 0, 1, 2, 3. This is a new public API on wacore-libsignal's SessionRecord/SenderKeyRecord, so it needed documentation alongside the existing counter-lease writeup in advanced/signal-protocol.mdx.

Test plan

  • Reviewed the rendered subsection against the PR body, diff, and new tests in wacore/libsignal/tests/counter_lease.rs / wacore/libsignal/src/protocol/group_cipher.rs for accuracy (per-type failure behavior, archived-state burn, default-unchanged guarantee).
  • Docs build/preview (Mintlify) — not run in this environment.

Ref: oxidezap/whatsapp-rust#1211


Generated by Claude Code


Summary by cubic

Documents the counter‑lease waiver opt‑out in advanced/signal-protocol.mdx for SessionRecord::waive_counter_lease() and SenderKeyRecord::waive_counter_lease().

Adds a new “Waiving the counter lease” subsection that explains when to use it, the durability trade‑off, per‑record failure behavior, and that pre‑existing reservations burn once; cross‑links from “Record components”, fixes the SignalStoreCache trusted‑reload comparison to call out a live‑cache incarnation (not synchronous durability), and splits a dense sentence per the style guide.

Written for commit 4c6c766. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added documentation for disabling counter leases on individual session and sender-key records when using synchronous durable storage.
    • Documented the resulting behavior, including fail-closed handling for stale session chains and error reporting for sender-key records.
  • Documentation

    • Updated Record component documentation with links and guidance for the counter-lease opt-out behavior.
    • Clarified that default counter-lease behavior remains unchanged.

whatsapp-rust#1211 added SessionRecord::waive_counter_lease and
SenderKeyRecord::waive_counter_lease, letting a consumer whose own
persistence is already synchronous and durable before the wire opt out
of the batched counter lease that otherwise burns a full reservation
on every component export. Document the API, its trade-off, and the
per-record-type failure behavior, and cross-link it from the Record
components section it primarily benefits.

Ref: oxidezap/whatsapp-rust#1211
@mintlify

mintlify Bot commented Aug 5, 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 5, 2026, 10:38 PM

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

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Signal protocol documentation now describes per-record waive_counter_lease() methods for synchronously durable consumers. It covers session and sender-key stale-chain behavior, security tradeoffs, unchanged defaults, and Record component export effects.

Changes

Counter Lease Documentation

Layer / File(s) Summary
Record lease behavior documentation
advanced/signal-protocol.mdx
Documents counter-lease opt-out methods, caller policy, security tradeoffs, stale-chain handling, default behavior, and Record component export effects.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit reads the lease notes bright,
Session chains now fail closed right.
Sender keys keep leases when errors appear,
Durable stores make the policy clear.
The Record guide hops into view. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely states that the pull request documents the counter-lease waiver opt-out.

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 5, 2026

Copy link
Copy Markdown

Greptile Summary

Adds documentation for per-record counter-lease waivers on session and sender-key records, aimed at component-backed stores with synchronous durable persistence.

  • Explains the durability trade-off and the need to reapply the waiver after every load.
  • Documents existing-reservation materialization and type-specific failure behavior.
  • Cross-links the waiver guidance from the record-components section.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
advanced/signal-protocol.mdx Documents the counter-lease waiver API, its persistence requirements, reservation behavior, failure semantics, and component-store use case.

Reviews (2): Last reviewed commit: "docs(signal-protocol): split dense lease..." | Re-trigger Greptile

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

@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.

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@advanced/signal-protocol.mdx`:
- Line 1334: Update the trusted-reload comparison in the paragraph beginning
“This gives up a real guarantee” to apply only to direct Device stores. Remove
or qualify the claim that synchronous durable persistence before sending is
required, since SignalStoreCache trusted reload relies on a matching live-cache
incarnation and warm sends use write-behind.
- Line 1319: Revise the subsection around the durable snapshot and component
export discussion to address the reader directly with “you” and active voice.
Split dense sentences so policy, persistence, recovery, and export behavior are
each expressed as concise, separate statements, including the text around the
component export explanation and the counter example.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 27020d37-e98f-4465-b7b1-10cc0ab2de65

📥 Commits

Reviewing files that changed from the base of the PR and between ccb36d2 and 8d34e5b.

📒 Files selected for processing (1)
  • advanced/signal-protocol.mdx

Comment thread advanced/signal-protocol.mdx Outdated
Comment thread advanced/signal-protocol.mdx Outdated
SignalStoreCache's trusted reload is a matching live-cache incarnation,
not synchronous durability -- its warm sends use the coalesced
write-behind. Only a direct Device store's trusted-reload rationale
ties to synchronous durability. Corrects an inaccurate comparison
flagged by review.
@greptile-apps
greptile-apps Bot dismissed their stale review August 5, 2026 22:40

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

@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: 8d34e5b7c9

ℹ️ 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/signal-protocol.mdx Outdated
AGENTS.md asks for one idea per sentence. Break the run-on covering
eligibility, the motivating case, and why into_components() re-burns
the reservation into separate sentences.

@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: Documentation-only update to signal-protocol.mdx; no code, API, data, or operational behavior changes. The documented durability tradeoff belongs to the referenced prior code PR, so no human-owned product or architectural decision remains here.

Re-trigger cubic

@jlucaso1
jlucaso1 merged commit 306dac8 into main Aug 5, 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.

2 participants