docs: document source-aware LID-PN write policy (whatsapp-rust#1011) - #400
Conversation
The LID-PN cache no longer applies every learn unconditionally: the LearningSource now also selects a write policy (directed sources overwrite, observational bulk sources only seed new LIDs and trigger a live re-resolve on conflict, stale sources are timestamp-floored) matching WhatsApp Web's createLidPnMappings. Update the LearningSource reference table, the storage cache-patching writeup, and the state-management cache-patching summary.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 26 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 (3)
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 |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Confidence score: 5/5
- Safe to merge after the addressed issues were fixed.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Auto-approved: Documentation-only update to describe source-aware LID-PN write policy.
Re-trigger cubic
The summary table still listed the old three-source shorthand and framed the write-policy gate as a post-hoc fallback, addressing greptile review feedback on PR #400.
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Auto-approved: Documentation-only changes across three .mdx files. Updates describe source-aware LID-PN write policy behavior — no logic, config, infrastructure, or test changes.
Re-trigger cubic
…gon) Drop the state-management paragraph that duplicated both the summary table and the following cross-reference link, and explain what "capacity-bounded eviction" means in the LearningSource Note instead of assuming reader familiarity with the cache config.
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Auto-approved: Documentation-only changes: updated LearningSource table with write-policy column, expanded storage docs, and updated state-management summary. No code or logic changes.
Re-trigger cubic
Summary
Documents oxidezap/whatsapp-rust#1011, which changed the LID-PN cache from unconditional last-write-wins to a source-aware write policy matching WhatsApp Web's
createLidPnMappings(switch (learningSource)):Usync,PeerPnMessage,PeerLidMessage,RecipientLatestLid,MigrationSyncLatest,MigrationSyncOld,BlocklistActive,BlocklistInactive) overwrite the cache on any change.Other,Pairing,DeviceNotification) only ever seed a brand-new LID; a conflict with an already-known LID no longer clobbers it — instead a live LID query is queued and the authoritative result is learned underUsync.MigrationSyncOld/BlocklistInactiveare stampedcreated_at = 0so they never outrank a fresher mapping.Also folds in the companion behavior from #1010: the history-sync
phoneNumberToLidMappingsseed is taggedOther(notMigrationSyncLatest, which is now solely the live 1:1 LID migration flow's source), so it's correctly documented as an observational/conservative source.What changed
api/client.mdx—LearningSourcereference: added a "Write policy" column to the table, plus explanatory paragraphs on directed vs. observational vs. stale-source behavior. Corrected theMigrationSyncLatestdescription (no longer the history-sync seed source) and theOtherdescription (now covers the history-sync seed).concepts/storage.mdx— Granular cache patching → LID-PN mappings: documented the newlid_pn_write_policygate that runs before the existing timestamp-based conflict resolution, including the live-query reconcile path.advanced/state-management.mdx— Cache patching strategy summary table: updated the LID-PN mappings row and added a short cross-reference to the fuller writeup inconcepts/storage.mdx.No changelog entry added per instructions (changelog entries are human-authored only).
Test plan
MigrationSyncLatest/Othersource claims against the currentwhatsapp-rustsource (src/client/lid_pn.rs,wacore/src/types/lid_pn.rs) —MigrationSyncLatestis only referenced by the live LID-migration-sync handler; the history-sync harvest usesOther.Generated by Claude Code
Summary by cubic
Document the source‑aware LID–PN write policy to match WhatsApp Web: directed sources overwrite; observational sources only seed new LIDs and queue a live re‑resolve; stale sources write with
created_at = 0so fresher data wins. Updated theLearningSourcereference (write‑policy column and a note that explains capacity‑bounded eviction), expanded storage docs (write gate and live reconcile), clarified that history‑sync seeds areOtherwhileMigrationSyncLatestis only for the live migration flow, updated the state‑management summary row, and removed a redundant paragraph and a dangling fragment.Written for commit 59fb90c. Summary will update on new commits.