docs: document 1:1 LID migration gating for DM wire addressing - #360
Conversation
…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
|
Warning Review limit reached
Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
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. Comment |
There was a problem hiding this comment.
💡 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".
|
|
||
| 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 |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
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
left a comment
There was a problem hiding this comment.
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
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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 withack error="400"from accounts that aren't yet 1:1-LID-migrated. The library now gates this account-level decision on a new persistedDevice.lid_migratedflag, decoupled from Signal session addressing (which stays LID-first unconditionally).Changes
advanced/signal-protocol.mdx— new "DM wire namespace vs. Signal session addressing" subsection explainingresolve_dm_wire_jid()and how it differs fromresolve_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-onlylid_migration_mapping_sync_messagehandler.advanced/state-management.mdx— addedDeviceCommand::SetLidMigrated(bool)to the command enum/match listing.concepts/storage.mdx— added thelid_migratedfield to theDevicestruct doc and the SQLite schema block.api/client.mdx— documented the new publicClient::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(), persistedDevice.lid_migrated,DeviceCommand::SetLidMigrated,Client::is_lid_migrated(), and the SQLite schema update.Written for commit b5aa11e. Summary will update on new commits.