Skip to content

docs(signal-protocol): document per-device session-setup isolation for group SKDM (whatsapp-rust#996) - #394

Merged
jlucaso1 merged 1 commit into
mainfrom
claude/nifty-bohr-ba9oxl
Jul 7, 2026
Merged

docs(signal-protocol): document per-device session-setup isolation for group SKDM (whatsapp-rust#996)#394
jlucaso1 merged 1 commit into
mainfrom
claude/nifty-bohr-ba9oxl

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Documents the fix from oxidezap/whatsapp-rust#996, which was just merged.

  • ensure_sessions_for_devices used to abort the entire SessionPlan (and thus the whole SKDM fan-out) the moment process_prekey_bundle failed for any single target device.
  • Since prepare_group_stanza gates the fan-out on session_plan.is_some(), one bad device silently starved every other cohort member's SKDM — and an own companion could get stuck permanently has_key=true because mark_forget_sender_key excludes own-user JIDs.
  • The fix logs and skips the failing device instead, matching WhatsApp Web's per-device try/catch in GroupKeyDistributionMsg.

Added a new <Note> in advanced/signal-protocol.mdx right after the existing "Per-device session lock around the SKDM fan-out (v0.6)" note (which documents the related #990 fix), following the same style/versioning convention used for the other v0.6 group-send notes in that file.

Test plan

  • Reviewed the rendered note for accuracy against the whatsapp-rust#996 diff and description
  • Docs site build/preview (not run in this environment)

Generated by Claude Code


Summary by cubic

Adds a v0.6 note to advanced/signal-protocol.mdx documenting per-device isolation of session-setup failures during group SKDM fan-out, so one device’s failure no longer cancels the whole SessionPlan. This reflects the fix in oxidezap/whatsapp-rust#996 and matches WhatsApp Web’s per-device try/catch behavior.

Written for commit 1bc40e4. Summary will update on new commits.

…r group SKDM (whatsapp-rust#996)

Explains that a single device's process_prekey_bundle failure no longer
nulls the whole SessionPlan and starves the rest of the cohort's SKDM,
including why own companions previously got stuck at has_key=true forever.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 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: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: 36de0a40-24f1-4e42-8004-d7747a1ee186

📥 Commits

Reviewing files that changed from the base of the PR and between 3dc9f07 and 1bc40e4.

📒 Files selected for processing (1)
  • advanced/signal-protocol.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.

@mintlify

mintlify Bot commented Jul 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 Jul 7, 2026, 2:41 AM

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

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

No issues found across 1 file

Confidence score: 5/5

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

Auto-approved: Pure documentation change: adds a technical note about a previous bug fix in the signal protocol docs. Only modifies one markdown file with 6 lines added. No source code, config, or logic changes.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown

Greptile Summary

Adds a single <Note> block to advanced/signal-protocol.mdx documenting the whatsapp-rust#996 fix, which changed ensure_sessions_for_devices to log-and-skip a failing device rather than abort the entire SessionPlan.

  • The note accurately describes the original bug (one X3DH failure nulling the whole SKDM plan via the session_plan.is_some() gate), the permanent stuck-state for own companions caused by mark_forget_sender_key filtering own-user JIDs, and the fix that matches WhatsApp Web's per-device try/catch in GroupKeyDistributionMsg.
  • Placement, title format, (v0.6) version tag, and cross-reference style all match the adjacent #990 note and the other v0.6 notes throughout the file.

Confidence Score: 5/5

Pure documentation addition — no code is changed, no logic is modified, and the new note accurately reflects the whatsapp-rust#996 diff.

The change is a single <Note> block appended to an .mdx file. The described behavior (log-and-skip vs. abort-on-first-failure, the session_plan.is_some() gate, and the mark_forget_sender_key / exclude_own_devices stuck-state) matches the referenced PR description. Style, versioning, and placement are consistent with adjacent notes in the file.

No files require special attention.

Important Files Changed

Filename Overview
advanced/signal-protocol.mdx Adds a new <Note> documenting the per-device session-setup failure isolation fix (#996), placed correctly after the sibling #990 note and following established style/versioning conventions.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[prepare_group_stanza called] --> B[ensure_sessions_for_devices]
    B --> C{For each target device: process_prekey_bundle}

    subgraph OLD["Before #996 (old behavior)"]
        C -- "any failure" --> D["Return Err — entire call aborts"]
        D --> E["session_plan = None"]
        E --> F["is_some() gate: SKDM skipped for ALL devices"]
        F --> G["skmsg still ships, phash covers full set"]
        G --> H["External members: retry receipt → recovers"]
        G --> I["Own companion: mark_forget_sender_key\nexclude_own_devices=true → stuck has_key=true forever"]
    end

    subgraph NEW["After #996 (current behavior)"]
        C -- "device fails" --> J["Log error, skip failing device"]
        J --> K["Continue to next device"]
        C -- "device succeeds" --> K
        K --> L["Return Ok(SessionPlan) with successful devices"]
        L --> M["is_some() gate: SKDM proceeds"]
        M --> N["encrypt fan-out skips sessionless device naturally"]
        N --> O["All other devices receive pairwise SKDM ✓"]
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[prepare_group_stanza called] --> B[ensure_sessions_for_devices]
    B --> C{For each target device: process_prekey_bundle}

    subgraph OLD["Before #996 (old behavior)"]
        C -- "any failure" --> D["Return Err — entire call aborts"]
        D --> E["session_plan = None"]
        E --> F["is_some() gate: SKDM skipped for ALL devices"]
        F --> G["skmsg still ships, phash covers full set"]
        G --> H["External members: retry receipt → recovers"]
        G --> I["Own companion: mark_forget_sender_key\nexclude_own_devices=true → stuck has_key=true forever"]
    end

    subgraph NEW["After #996 (current behavior)"]
        C -- "device fails" --> J["Log error, skip failing device"]
        J --> K["Continue to next device"]
        C -- "device succeeds" --> K
        K --> L["Return Ok(SessionPlan) with successful devices"]
        L --> M["is_some() gate: SKDM proceeds"]
        M --> N["encrypt fan-out skips sessionless device naturally"]
        N --> O["All other devices receive pairwise SKDM ✓"]
    end
Loading

Reviews (1): Last reviewed commit: "docs(signal-protocol): document per-devi..." | Re-trigger Greptile

@jlucaso1
jlucaso1 merged commit 4424afc into main Jul 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.

2 participants