Skip to content

docs: document 1:1 LID migration gating for DM wire addressing - #360

Merged
jlucaso1 merged 3 commits into
mainfrom
claude/nifty-bohr-kizumx
Jul 2, 2026
Merged

jlucaso1 merged 3 commits into
mainfrom
claude/nifty-bohr-kizumx

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Documents oxidezap/whatsapp-rust#943, which fixes oxidezap/whatsapp-rust#941: DM wire addressing (the outer <message to> / <participants> namespace) was upgrading PN → LID unconditionally, but WhatsApp's servers reject LID-addressed DMs with ack error="400" from accounts that aren't yet 1:1-LID-migrated. The library now gates this account-level decision on a new persisted Device.lid_migrated flag, decoupled from Signal session addressing (which stays LID-first unconditionally).

Changes

  • advanced/signal-protocol.mdx — new "DM wire namespace vs. Signal session addressing" subsection explaining resolve_dm_wire_jid() and how it differs from resolve_encryption_jid(); updated the "Own-device namespace alignment" note to reflect the new gating.
  • concepts/authentication.mdx — new "1:1 LID migration state" subsection covering the two sources that set the flag: pair-success <client-props> (isChatDbLidMigrated) and the self-only lid_migration_mapping_sync_message handler.
  • advanced/state-management.mdx — added DeviceCommand::SetLidMigrated(bool) to the command enum/match listing.
  • concepts/storage.mdx — added the lid_migrated field to the Device struct doc and the SQLite schema block.
  • api/client.mdx — documented the new public Client::is_lid_migrated() method.

No changelog entry included per repo convention (changelog entries are added by a human).


Generated by Claude Code


Summary by cubic

Documents the 1:1 LID migration gate for DM wire addressing to prevent 400-nacked LID DMs from unmigrated accounts. DMs stay PN until migrated, while Signal session addressing remains LID-first; adds docs for resolve_dm_wire_jid(), persisted Device.lid_migrated, DeviceCommand::SetLidMigrated, Client::is_lid_migrated(), and the SQLite schema update.

  • Bug Fixes
    • Renamed the heading to "One-to-one LID migration state" and updated cross-links to fix a broken anchor.
    • Lowercased the "DeviceCommand pattern" anchor link to match Mintlify slugging and fix the reference.

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

Review in cubic

…app-rust#943)

Documents the fix for whatsapp-rust#941/#943: DM wire addressing (the
stanza to/<participants> namespace) is now gated on a persisted
Device.lid_migrated flag instead of upgrading PN to LID unconditionally,
since the server 400-nacks LID-addressed DMs from accounts that aren't
1:1-LID-migrated yet. Covers the new resolve_dm_wire_jid() split from
Signal session addressing, the pair-success client-props / migration
mapping sync sources for the flag, the new is_lid_migrated() method,
DeviceCommand::SetLidMigrated, and the Device.lid_migrated field.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014P5H5T3XKxwfwSKmSomqzt
@coderabbitai

coderabbitai Bot commented Jul 2, 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: 36 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: 70c60a84-3d1c-43a7-a85f-c8d0809d9577

📥 Commits

Reviewing files that changed from the base of the PR and between 8fb688f and b5aa11e.

📒 Files selected for processing (5)
  • advanced/signal-protocol.mdx
  • advanced/state-management.mdx
  • api/client.mdx
  • concepts/authentication.mdx
  • concepts/storage.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.

@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: deb94b049e

ℹ️ 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 concepts/authentication.mdx Outdated

Since v0.6 the client persists a `login_counter` on `Device`. Every successful connect increments it and the new value is sent as `ClientPayload.lc` during the Noise handshake. This mirrors WA Web's anti-abuse signal — the server uses the counter to spot replayed or cloned `ClientPayload`s. The counter resets when you call `logout()` or wipe device state.

### 1:1 LID migration state

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add an explicit anchor for the 1:1 migration heading

Mintlify removes special characters when generating heading anchors, so this heading becomes #11-lid-migration-state, while the new cross-links point to /concepts/authentication#1-1-lid-migration-state. Those links will not jump to this section until the heading gets an explicit {#1-1-lid-migration-state} anchor or the links are updated.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch — fixed in 7f52ab4 by rewording the heading to "One-to-one LID migration state" (avoids the colon entirely) and updating the three cross-links, rather than relying on an untested {#anchor} override.


Generated by Claude Code

Mintlify strips the colon from "1:1", collapsing the heading's
auto-generated anchor to #11-lid-migration-state instead of the
#1-1-lid-migration-state the cross-links assumed. Reword the heading
to "One-to-one LID migration state" (unambiguous slug) and update the
three cross-references instead of relying on an untested explicit
{#anchor} attribute.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014P5H5T3XKxwfwSKmSomqzt

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

1 issue found and verified against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread concepts/authentication.mdx Outdated
Mintlify lowercases generated heading anchors, so
#deviceCommand-pattern doesn't resolve. Matches the pre-existing
same-bug link on line 683, which is out of scope for this PR.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014P5H5T3XKxwfwSKmSomqzt

@jlucaso1 jlucaso1 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Valid — fixed in b5aa11e, applied your suggested diff exactly. Left the same pre-existing bug at line 683 untouched since it's outside this PR's diff.


Generated by Claude Code

@mintlify

mintlify Bot commented Jul 2, 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 2, 2026, 4:57 PM

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

@jlucaso1
jlucaso1 merged commit 60d2ca8 into main Jul 2, 2026
3 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.

DMs to LID-mapped peers are 400-nacked on some companion registrations, even with #731's consistent-LID stanza

2 participants