-
-
Notifications
You must be signed in to change notification settings - Fork 123
feat(wacore): bind five more enums to the catalog and retire a dead event #1310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
db1e262
561cea0
4e42562
b8e202a
c4cf44a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -241,7 +241,11 @@ pub enum EventKind { | |
| IncomingCall, | ||
| MissedCall, | ||
| CallEndedElsewhere, | ||
| PushNameUpdate, | ||
| /// Retired: the payload promised an old-name/new-name comparison this | ||
| /// client has no contact store to make, and nothing ever dispatched it. | ||
| /// The slot stays because the discriminant is an `EventInterest` bit index | ||
| /// a consumer persists, so removing it would re-point every mask past it. | ||
| RetiredPushNameUpdate, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Renaming this kind and removing AGENTS.md reference: AGENTS.md:L35-L35 Useful? React with 👍 / 👎.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The compile break was real and mine: I checked On retaining the names, I'm keeping the removal, deliberately. The crate is pre-1.0 and the repo owner has confirmed breaking changes are acceptable there when the PR carries a migration line, which the body now does. The reason a deprecated shim is worse than removal here: The frozen-payload contract in What is genuinely frozen is the Generated by Claude Code |
||
| SelfPushNameUpdated, | ||
| PinUpdate, | ||
| MuteUpdate, | ||
|
|
@@ -921,7 +925,6 @@ pub enum Event { | |
| /// Rejected call-log outcomes (`<terminate reason="accepted_elsewhere"|"rejected_elsewhere">`). | ||
|
greptile-apps[bot] marked this conversation as resolved.
greptile-apps[bot] marked this conversation as resolved.
|
||
| CallEndedElsewhere(CallEndedElsewhere), | ||
|
|
||
| PushNameUpdate(PushNameUpdate), | ||
| SelfPushNameUpdated(SelfPushNameUpdated), | ||
|
jlucaso1 marked this conversation as resolved.
|
||
| PinUpdate(PinUpdate), | ||
| MuteUpdate(MuteUpdate), | ||
|
|
@@ -1119,7 +1122,6 @@ impl Event { | |
| Event::IncomingCall(_) => EventKind::IncomingCall, | ||
| Event::MissedCall(_) => EventKind::MissedCall, | ||
| Event::CallEndedElsewhere(_) => EventKind::CallEndedElsewhere, | ||
| Event::PushNameUpdate(_) => EventKind::PushNameUpdate, | ||
| Event::SelfPushNameUpdated(_) => EventKind::SelfPushNameUpdated, | ||
| Event::AppStateSyncFailed(_) => EventKind::AppStateSyncFailed, | ||
| Event::PinUpdate(_) => EventKind::PinUpdate, | ||
|
|
@@ -1668,13 +1670,7 @@ pub struct DirtyState { | |
| pub timestamp: Option<u64>, | ||
| } | ||
|
|
||
| #[derive(Debug, Clone, Copy, PartialEq, Eq, crate::WireEnum)] | ||
| pub enum DecryptFailMode { | ||
| #[wire = "show"] | ||
| Show, | ||
| #[wire = "hide"] | ||
| Hide, | ||
| } | ||
| pub use crate::types::wire_enums::DecryptFailMode; | ||
|
|
||
| #[derive(Debug, Clone, Copy, PartialEq, Eq, crate::WireEnum)] | ||
| pub enum UnavailableType { | ||
|
|
@@ -2207,16 +2203,6 @@ pub struct ContactUpdate { | |
| pub from_full_sync: bool, | ||
| } | ||
|
|
||
| #[derive(Debug, Clone, Serialize, bon::Builder)] | ||
| #[non_exhaustive] | ||
| pub struct PushNameUpdate { | ||
| /// The contact who changed their push name. | ||
| pub jid: Jid, | ||
| pub message: Box<MessageInfo>, | ||
| pub old_push_name: String, | ||
| pub new_push_name: String, | ||
| } | ||
|
|
||
| #[derive(Debug, Clone, Serialize, bon::Builder)] | ||
| #[non_exhaustive] | ||
| pub struct PinUpdate { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,7 @@ | ||
| use chrono::{DateTime, Utc}; | ||
| use waproto::whatsapp as wa; | ||
|
|
||
| #[derive(Debug, Clone)] | ||
| pub struct VerifiedName { | ||
| pub certificate: Box<wa::VerifiedNameCertificate>, | ||
| pub details: Box<wa::verified_name_certificate::Details>, | ||
| } | ||
|
|
||
| #[derive(Debug, Clone, Default)] | ||
| pub struct LocalChatSettings { | ||
| pub found: bool, | ||
| pub muted_until: Option<DateTime<Utc>>, | ||
| pub pinned: bool, | ||
| pub archived: bool, | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the status composer's
MediaTypechanges independently—for example, by gaining a status-only kind—the next regeneration will incorrectly add that value toCallLinkMedia, even though this type is used to build and parse call-link stanzas inwacore/src/stanza/group_call.rs.WAWebStatusSetupControlleris not the call-link protocol, and the commit's identical-variant-set match does not establish that it owns the same wire enum; keep this type handwritten until the actual call-link source is identified, or bind that source instead.AGENTS.md reference: AGENTS.md:L5-L5
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, and this is the one binding in the sweep that was actually wrong. Reverted in b8e202a —
CallLinkMediagoes back to hand-written.I checked the catalog before reverting:
WAWebStatusSetupController::MediaTypeis the only entry whose variant set is exactly{audio, video}, and there is no call-link media enum anywhere in the 403, so there is nothing correct to bind instead. Meanwhile the type builds and parses<call_link>throughbuild_call_link_create,build_call_link_joinandparse_call_link_media. So the match was two unrelated two-valued media enums agreeing by coincidence, and a status-only kind added upstream would have landed in call-link stanzas on the next sync.The underlying mistake is worth naming, because my own PR body advertised it as a feature: matching on variant sets is how a candidate gets found, not how it gets decided. The module has to own the wire format we parse. The other five hold up under that test —
MemberAddModefrom the group metadata schema,MemberShareGroupHistoryModefrom the history-share module,PrivacyUserActionfrom the privacy job,GROUP_PARTICIPANT_TYPESfrom the group API, andDecryptFailTypefrom the sameWAWebBackendJobs.flowthat already ownsEncMediaTypeand the<enc>node — each is used for exactly what its module governs. Only this one crossed a domain boundary.That rule is now in the emitter's module doc rather than only here, since a comment on a rejected candidate is not where the next sweep will look.
Generated by Claude Code