Skip to content

Follow the library's JID change, and move it and gpui on again - #64

Merged
jlucaso1 merged 1 commit into
mainfrom
claude/version-bumps-whatsapp-gpui-8g54r2
Aug 31, 2026
Merged

Follow the library's JID change, and move it and gpui on again#64
jlucaso1 merged 1 commit into
mainfrom
claude/version-bumps-whatsapp-gpui-8g54r2

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

A follow-up to #63: cargo update again, plus the one line upstream made stop
compiling.

The git sources

The one line that had to follow

fallback_chat_name carried exactly the carve-out that change removes. It
asked is_pn_family() || server == Server::Legacy, because a JID parsed out
of 12025550144@c.us used to answer a server that family did not include. It
now parses as Pn, so the family test alone is the whole question and the
second half names nothing.

Dropping it is the fix rather than a rewrite, and the behaviour is not taken
on trust: chat_fallback_hides_internal_lid already builds a chat from
12025550144@c.us and expects +12025550144, so both spellings are still
asserted to reach the same name.

Verified

cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace (every suite green, that test
included), plus cargo +nightly check on wasm32-unknown-unknown for both
oxidezap-gui and oxidezap-session.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZQ28Vqpc3pCasXu3Rzzja


Generated by Claude Code


Summary by cubic

Updates whatsapp-rust and gpui to their latest commits and fixes fallback_chat_name to match the upstream JID parse change.

Upstream now resolves c.us addresses to the phone namespace (Server::Pn) and removes Server::Legacy. The old code checked for Server::Legacy because c.us didn't match the phone family; that check is no longer needed. The existing test chat_fallback_hides_internal_lid already covers both @c.us and @s.whatsapp.net spellings, so behavior is unchanged.

Written for commit 57d1d7f. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved chat naming for legacy server conversations.
    • Legacy server chats now display “Unknown chat” instead of an incorrect numeric phone-number name.

`cargo update` on top of #63, plus the one line upstream made stop
compiling.

- **whatsapp-rust** and its ten satellites: `210bf742` -> `2421037e`.
  `c.us` is no longer a namespace of its own: it is the other spelling of
  the phone namespace, and `Server::parse_known` now resolves it to
  `Server::Pn` so one person cannot become two identities
  (oxidezap/whatsapp-rust#1371). `Server::Legacy` is gone with it, and the
  discriminant is left as a gap rather than reused.
- **zed** (`gpui`, `gpui_platform` and their satellites): `76b1096c` ->
  `9785475c`, two commits, neither of which this tree calls.
- **gpui-component** did not move; it is already at the tip #63 put it on.

`fallback_chat_name` had the carve-out that change removes: it asked
`is_pn_family() || server == Server::Legacy`, because a JID parsed out of
`12025550144@c.us` used to answer a server that family did not include.
It now parses as `Pn`, so the family test alone is the whole question and
the second half no longer names anything. Dropping it is the fix rather
than a rewrite -- `chat_fallback_hides_internal_lid` already asks a
`@c.us` chat for its name and expects the number, so the behaviour this
guards is unchanged and tested from both spellings.

Verified: `cargo fmt --all -- --check`, `cargo clippy --workspace
--all-targets -- -D warnings` and `cargo test --workspace` clean, plus
`cargo +nightly check` on `wasm32-unknown-unknown` for `oxidezap-gui` and
`oxidezap-session`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ZQ28Vqpc3pCasXu3Rzzja
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T18:33:07.198476Z 57d1d7f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b8d76ce7-a0ae-47d3-9c2c-c49c49537821

📥 Commits

Reviewing files that changed from the base of the PR and between 3202b86 and 57d1d7f.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • crates/core/src/chat.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The chat name fallback now applies numeric phone-number names only to PN-family JIDs. Legacy-server JIDs now use "Unknown chat". The unused Server import was removed.

Changes

Chat name fallback

Layer / File(s) Summary
PN-only fallback classification
crates/core/src/chat.rs
The unused Server import was removed. Numeric phone-number fallback names now apply only to PN-family JIDs. Legacy-server JIDs use "Unknown chat".

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 57d1d

The update aligns chat fallback naming with the library’s JID parsing change while refreshing dependencies, with the affected behavior covered by existing tests; no actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit checked the JID trail

PN names hop along the rail
Server paths now calmly state
“Unknown chat” at the gate
Clean imports finish the tale

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references the JID compatibility change and the GPUI dependency update, which are central parts of the pull request. The wording is somewhat informal but remains clear and related to the cha…
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.
Full details: Title check

Explanation

The title references the JID compatibility change and the GPUI dependency update, which are central parts of the pull request. The wording is somewhat informal but remains clear and related to the changes.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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: 57d1d7ff57

ℹ️ 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 Cargo.lock
name = "wacore-binary"
version = "0.7.0"
source = "git+https://github.com/oxidezap/whatsapp-rust?branch=main#210bf74226a450045064b3f980931e58567e82dc"
source = "git+https://github.com/oxidezap/whatsapp-rust?branch=main#2421037ef271d36280a30cb1980a423ab5509f86"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Migrate stored legacy JID keys before canonicalizing them

For databases populated before this upgrade, route_chat_key stored @c.us addresses verbatim because Server::Legacy was not treated as a PN, but the updated parser now turns those rows into Server::Pn while queries such as page_with_unread filter only by the canonical @s.whatsapp.net/LID strings. The chat-list row therefore still appears after parsing, but its existing messages, receipts, reactions, and contact data are missed; subsequent traffic can also create a second PN-keyed row. Add a chat-store migration that merges/rewrites every persisted JID key and reference from @c.us to its canonical PN spelling, including collision handling.

AGENTS.md reference: AGENTS.md:L19-L22

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The mechanism is real and I checked it rather than taking it: user_chat admits only Server::Pn | Server::Lid, so before this bump 12025550144@c.us fell out of route_chat_key as the wire string verbatim and was filed under …@c.us; after it, the same address parses as Pn, into_non_ad().to_string() renders …@s.whatsapp.net, and a row already sitting under the old spelling is no longer what the new traffic routes to.

What I could not establish is that such rows exist. c.us is not in the binary token dictionary (wacore/binary/src/tokens.json carries s.whatsapp.net and not it), so the compact form the server sends is the canonical one; the paths upstream guarded for it — canonical_user_server, is_self_dm_recipient — are about a to a caller supplies on the send path, not about an inbound address. That leaves a raw JID_PAIR server string or a history-sync conversation.id as the only ways in, and I have no capture of either carrying it.

So this is not something I can fix by reading; it needs a migration and a decision. What it would look like, mirroring 2026-07-24-000000_bare_identity_keys, which folds device-suffixed keys onto the bare identity in exactly this shape: rewrite chats.jid, messages.chat_jid/sender_jid, reactions.chat_jid/sender_jid, contacts.jid and message_receipts.chat_jid/user_jid from …@c.us to …@s.whatsapp.net, with INSERT OR IGNORE into the canonical key first and a delete after, so a peer that already holds both spellings merges rather than colliding on the primary key. It no-ops on every store that never held one.

I have not pushed it: this PR is a lock-file bump plus the one line the removed variant made stop compiling, and a five-table migration is a change of a different kind. Raising it here once, with the patch described, for @jlucaso1 to decide whether it belongs on this branch or its own.


Generated by Claude Code

@jlucaso1
jlucaso1 merged commit 3bbbd05 into main Aug 31, 2026
11 checks passed
@jlucaso1
jlucaso1 deleted the claude/version-bumps-whatsapp-gpui-8g54r2 branch August 31, 2026 18:42
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