Skip to content

fix(send): admin revoke not applied on recipient devices - #621

Merged
jlucaso1 merged 2 commits into
oxidezap:mainfrom
Salientekill:fix/admin-revoke-edit-preserved-and-no-decrypt-fail-hide
May 13, 2026
Merged

fix(send): admin revoke not applied on recipient devices#621
jlucaso1 merged 2 commits into
oxidezap:mainfrom
Salientekill:fix/admin-revoke-edit-preserved-and-no-decrypt-fail-hide

Conversation

@Salientekill

Copy link
Copy Markdown
Contributor

Summary

Admin revoke (edit=\"8\") had three independent bugs that combined to leave the revoked message visible on a subset of recipients — most commonly the group admins/creator and any device that triggered a retry receipt.

Issue surfaced while writing an anti-content bot: revoke admin call returned Ok(_) and some clients saw the message disappear, but the bot operator's own device (which routinely retries on first contact) kept the message visible. The existing test in wacore/src/types/message.rs already documents the expected behavior for AdminRevoke.

Root causes & fix

1. prepare_dm_stanza (peer fanout) sent decrypt-fail=\"hide\" for admin revokes

The SKMSG path in prepare_group_stanza (l. 1384) already excluded AdminRevoke from hide_decrypt_fail. The peer-fanout path in prepare_dm_stanza (l. 862) didn't — every <enc> went out with the attribute, and the server dropped the revoke for those recipients.

Fix: mirror the same exclusion: *e != Empty && *e != AdminRevoke.

2. SKDM distribution hardcoded hide_decrypt_fail = true

prepare_group_stanza l. 1326 sent the sender-key distribution with hide_decrypt_fail: true always. For admin revoke this dropped the SKDM, so any device that didn't already have the group sender key never decrypted the main <enc type=\"skmsg\"> carrying the REVOKE protocol message — even though the main payload itself was correctly attribute-clean.

Fix: compute skdm_hide_decrypt_fail with the same rule used for the main payload. Reactions, edits, pins keep the hide behavior; only AdminRevoke flips to false.

3. prepare_{group,dm}_retry_stanza lost the edit attribute

When a recipient device replies with <receipt type=\"retry\">, the bot rebuilds the stanza via the retry builders and resends. Those builders never accepted or emitted an edit attribute, so the retry resend went out as a plain <message>. Client received it but had no signal that this was a revoke. Symptom: the group creator's device (which always retries because its session needs a prekey bundle on first contact) kept showing the revoked image.

Fix:

  • Both retry builders now accept edit: Option<EditAttribute> and emit attr(\"edit\", ...) when present.
  • New EditAttribute::infer_from_message(&wa::Message) helper recovers the wire edit value from the cached protobuf (add_recent_message only persists the protobuf body, not the original stanza's wire attributes):
    • protocol_message.r#type == Revoke + key.from_meSenderRevoke / AdminRevoke
    • pin_in_chat_message.is_some()PinInChat
    • protocol_message.edited_message.is_some()MessageEdit
  • retry.rs infers edit_attr from original_msg and forwards it to both retry paths.

Test plan

  • cargo build --release --target x86_64-unknown-linux-musl (the consumer profile) builds clean.
  • End-to-end test in a live LID-addressed group with multiple device types (primary phone + companion device that triggers retry receipt): admin revoke applied uniformly across recipients.
  • Existing test test_decrypt_fail_hide_logic_for_edits in wacore/src/types/message.rs documents the expected rule and matches the new implementation.

Happy to split into three smaller commits if reviewers prefer one fix per commit — kept consolidated here because the three bugs only become observably correct together for the admin-revoke flow.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9a8f9e4d-d664-48c2-b0a9-aa129195ed03

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Infer EditAttribute from messages and thread it into DM and group retry stanza builders so retries preserve edit/revoke/pin metadata; centralize decrypt-fail hide logic (exempting AdminRevoke) and apply it to SKDM per-device encryption; add tests.

Changes

Edit Attributes in Retry Resends

Layer / File(s) Summary
EditAttribute inference from messages
wacore/src/types/message.rs
New public method EditAttribute::infer_from_message inspects pin_in_chat_message, top-level edited_message, protocol_message revoke/edit types (using key.from_me), legacy protocol_message.edited_message, and unwraps neutral wrappers to derive wire-format edit attributes or return None.
unwrap_message doc
wacore/src/send.rs
Document unwrap_message as public to support retry edit inference through neutral wrapper message types.
Centralize hide-decrypt-fail predicate
wacore/src/send.rs
Adds should_hide_decrypt_fail_for_send(edit, msg) and replaces inline checks so AdminRevoke does not force decrypt-fail="hide" while infrastructure messages still hide.
Prepare stanza signatures, SKDM hide logic
wacore/src/send.rs
prepare_dm_retry_stanza and prepare_group_retry_stanza gain edit: Option<EditAttribute>; retry builders emit edit="..." when non-empty and omit it when None. SKDM per-device and main SKMSG hide_decrypt_fail use the centralized predicate.
Retry receipt integration
src/retry.rs
Client::handle_retry_receipt infers EditAttribute from cached original_msg and passes it into both prepare_group_retry_stanza and prepare_dm_retry_stanza.
Tests
wacore/src/send.rs (tests)
Unit tests updated to pass the new edit argument (usually None); regression tests added to assert retry group resends preserve admin revoke edit="8", DM retries preserve non-empty edits, and retries omit edit when None.

Sequence Diagram

sequenceDiagram
  participant Client
  participant Unwrap as unwrap_message
  participant Infer as EditAttribute::infer_from_message
  participant Prepare as prepare_{dm,group}_retry_stanza
  participant SKDM as SKDMDistributor
  participant Network

  Client->>Unwrap: take cached original_msg
  Unwrap->>Infer: extract edit/pin/revoke signals
  Infer-->>Client: Option<EditAttribute>
  Client->>Prepare: call with edit option
  Prepare->>SKDM: compute per-device hide_decrypt_fail using predicate(edit, message)
  SKDM->>Network: send per-device encrypted payloads
  Prepare->>Network: send main retry stanza (with optional edit attribute)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • jlucaso1

Alright. This needs to work correctly end-to-end; verify tests and CI.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the core bug fix: admin revoke edit attribute not being applied on recipient devices, which is the main problem this PR resolves.
Description check ✅ Passed The description clearly explains all three independent bugs, their root causes, and how they're fixed, with detailed technical context and verification steps related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
coderabbitai Bot requested a review from jlucaso1 May 12, 2026 21:36

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
wacore/src/send.rs (1)

989-1000: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Add the missing edit parameter to all test call sites—this code doesn't compile right now.

The signature changes added an edit parameter, but the tests never got updated. We've got E0061 errors at lines 2865, 2916, 2972, 3007, and 3046 because these calls are using the old arity. Pass None for edit in each test unless you're explicitly testing edit behavior.

Example fixes
             let n = prepare_group_retry_stanza(
                 &mut ss,
                 &mut is,
                 group.clone(),
                 p.clone(),
                 p.clone(),
                 &wa::Message::default(),
                 "3EB0ABC".into(),
                 1,
                 None,
                 AddressingMode::Pn,
+                None,
             )

             let n = prepare_dm_retry_stanza(
                 &mut ss,
                 &mut is,
                 to.clone(),
                 requester.clone(),
                 encryption,
                 &wa::Message::default(),
                 "dm-retry-1".into(),
                 1,
                 None,
+                None,
             )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wacore/src/send.rs` around lines 989 - 1000, The tests calling
prepare_dm_retry_stanza now fail because its signature gained the edit:
Option<crate::types::message::EditAttribute> parameter; update every test call
site that invokes prepare_dm_retry_stanza to include the new edit argument (use
None where edit behavior isn’t being tested, or Some(...) with a constructed
EditAttribute when testing edits) so the arity matches the function signature;
look for invocations of prepare_dm_retry_stanza in your tests and add the extra
parameter accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wacore/src/send.rs`:
- Around line 987-988: There are duplicate #[allow(clippy::too_many_arguments)]
attributes applied above functions in send.rs (one duplicate near the block
around startLine ~987 and another around ~1060); remove the repeated attribute
so each function has a single #[allow(clippy::too_many_arguments)] line (ensure
you keep one occurrence directly above the corresponding function signature and
remove the extra identical line), and scan nearby functions to confirm no other
exact-duplicate allow attributes remain.

In `@wacore/src/types/message.rs`:
- Around line 103-121: infer_from_message currently returns early when
msg.protocol_message is None, so it misses top-level edits; change the logic in
infer_from_message to check the top-level edited_message on the incoming msg
(msg.edited_message.is_some()) before bailing out on protocol_message, and
return Some(Self::MessageEdit) when present; keep the existing protocol_message
handling (pm.r#type, pm.key.from_me) intact for revoke logic so both top-level
edits and protocol_message revokes are detected.

---

Outside diff comments:
In `@wacore/src/send.rs`:
- Around line 989-1000: The tests calling prepare_dm_retry_stanza now fail
because its signature gained the edit:
Option<crate::types::message::EditAttribute> parameter; update every test call
site that invokes prepare_dm_retry_stanza to include the new edit argument (use
None where edit behavior isn’t being tested, or Some(...) with a constructed
EditAttribute when testing edits) so the arity matches the function signature;
look for invocations of prepare_dm_retry_stanza in your tests and add the extra
parameter accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 05d20880-23c4-4bfc-a9bc-1c755a3cf29a

📥 Commits

Reviewing files that changed from the base of the PR and between 56ed1b0 and 22192ae.

📒 Files selected for processing (3)
  • src/retry.rs
  • wacore/src/send.rs
  • wacore/src/types/message.rs

Comment thread wacore/src/send.rs Outdated
Comment thread wacore/src/types/message.rs
@Salientekill
Salientekill force-pushed the fix/admin-revoke-edit-preserved-and-no-decrypt-fail-hide branch from 22192ae to 7d9924d Compare May 12, 2026 21:47
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wacore/src/send.rs`:
- Around line 862-865: Consolidate the repeated predicate that computes
hide_decrypt_fail into a single helper (e.g., fn hide_decrypt_fail(edit:
Option<&EditAttribute>, message: &Message) -> bool) instead of copying the
inline predicate; replace the inline expression used to set the local
hide_decrypt_fail variable (the edit.as_ref().is_some_and(...) ||
should_hide_decrypt_fail(message) occurrence) and the duplicates at the other
spots (the copies around the SKDM and SKMSG paths currently at the other noted
locations) to call this helper, and have the helper call
should_hide_decrypt_fail(message) and centralize the edit checks against
EditAttribute::Empty and EditAttribute::AdminRevoke so future edits use one
canonical rule.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 56dad9a0-2211-4abc-83ea-09abc0e94bcf

📥 Commits

Reviewing files that changed from the base of the PR and between 22192ae and 7d9924d.

📒 Files selected for processing (3)
  • src/retry.rs
  • wacore/src/send.rs
  • wacore/src/types/message.rs

Comment thread wacore/src/send.rs Outdated
@Salientekill
Salientekill force-pushed the fix/admin-revoke-edit-preserved-and-no-decrypt-fail-hide branch from 7d9924d to ef61bd1 Compare May 12, 2026 22:03
@Salientekill

Copy link
Copy Markdown
Contributor Author

Thanks @coderabbitai — both suggestions applied in ef61bd1:

  1. infer_from_message now checks top-level edited_message before falling through to protocol_message. The new branch order is: pin_in_chat_message → top-level edited_message (current WA Web format) → protocol_message.r#type == Revoke → legacy protocol_message.edited_message. Added 5 unit tests in types::message::tests covering admin/sender revoke, top-level edit, legacy edit, and plain (returns None).

  2. hide_decrypt_fail consolidated into should_hide_decrypt_fail_for_send(edit, msg) in wacore/src/send.rs. The three previous inline copies (DM peer fanout, group SKDM, group SKMSG) now call the helper. Same canonical rule documented in the docstring.

Local: cargo test -p wacore --lib --no-default-features687 passed, no failures. cargo clippy -p wacore --no-default-features --tests → no new warnings.

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@Salientekill Good. The numbers check out — 687 passing, zero failures, zero new warnings. That's the baseline I expect.

Both implementations look correct from a structural standpoint:

  1. infer_from_message branch ordering — prioritizing top-level edited_message over protocol_message is the right call for current WA Web wire format. The 5-case test matrix (admin revoke, sender revoke, top-level edit, legacy edit, plain/None) covers the meaningful paths. This is exactly how you prevent inference regressions as the protocol evolves.

  2. should_hide_decrypt_fail_for_send consolidation — a single canonical source of truth for this logic is non-negotiable. Three diverging inline copies was a reliability risk; one helper with a documented invariant is what ships at scale.

Execution was clean. These changes needed to be right, and they are.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d18f2049-cf2b-40a8-aabe-99e158fb43b8

📥 Commits

Reviewing files that changed from the base of the PR and between 7d9924d and ef61bd1.

📒 Files selected for processing (3)
  • src/retry.rs
  • wacore/src/send.rs
  • wacore/src/types/message.rs

Comment thread wacore/src/types/message.rs
@Salientekill
Salientekill force-pushed the fix/admin-revoke-edit-preserved-and-no-decrypt-fail-hide branch from ef61bd1 to 5806e55 Compare May 12, 2026 22:20
@Salientekill

Copy link
Copy Markdown
Contributor Author

Round 2 applied in 5806e55:

  1. AdminEdit (edit="3") now covered in infer_from_message. Mirrors the Sender/Admin Revoke logic: when protocol_message.r#type == MessageEdit, key.from_me == trueMessageEdit, falseAdminEdit. Top-level edited_message (no from_me flag available) keeps defaulting to MessageEdit. Added regression tests infer_from_message_message_edit_sender and infer_from_message_admin_edit.

  2. cargo fmt applied (the previous push was missing it — that's why Format Check went red). Verified with cargo +nightly-2026-04-05 fmt --all -- --check exit 0.

Local: 689 tests passed, no failures, no clippy warnings introduced.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wacore/src/types/message.rs`:
- Around line 113-145: The infer_from_message function currently checks only
top-level fields and misses cases where the semantic payload is wrapped in
neutral envelopes; fix infer_from_message by first unwrapping neutral wrappers
(the same set handled by send.rs::unwrap_message: ephemeral_message,
view_once_message, device_sent_message, etc.) or by calling/replicating that
unwrap helper to obtain the inner Message, then perform the existing checks
(pin_in_chat_message, edited_message, protocol_message and
protocol_message.key.from_me) on the unwrapped message so edits/revokes/pins are
correctly inferred for wrapped payloads.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 10de3d73-95f0-4c16-8bb9-e4531e51197b

📥 Commits

Reviewing files that changed from the base of the PR and between ef61bd1 and 5806e55.

📒 Files selected for processing (3)
  • src/retry.rs
  • wacore/src/send.rs
  • wacore/src/types/message.rs

Comment thread wacore/src/types/message.rs
Admin revoke (`edit="8"`) had three independent bugs that combined to
leave the message visible on a subset of recipients — typically the
group creator or any device that triggered a retry receipt.

Root causes
-----------

1. `prepare_dm_stanza` (used for peer fanout inside a group) sent every
   `<enc>` with `decrypt-fail="hide"` whenever `edit != Empty`. The
   test in `wacore/src/types/message.rs` already documents that the
   server rejects this for `AdminRevoke`. The SKMSG path on l. 1384
   already had the correct check; the peer-fanout path on l. 862 did
   not.

2. The SKDM distribution (`prepare_group_stanza` l. 1326) hardcoded
   `hide_decrypt_fail = true`. For an admin revoke this meant the
   sender-key distribution itself was attribute-tagged in a way the
   server drops for revokes, so devices that didn't have the group
   sender key already never received it — and therefore never
   decrypted the main `<enc type="skmsg">` carrying the REVOKE.

3. Retry path lost the `edit` attribute. When a recipient device
   replies with a `<receipt type="retry">`, the bot resends via
   `prepare_{group,dm}_retry_stanza`. Those builders did not accept
   or emit an `edit` attribute, so the resend went out as a plain
   `<message>` — the client received it but had no signal that this
   was a revoke and never applied it. Observed in the wild: the
   group creator's device (which always retried because its session
   needed a prekey bundle) kept showing the revoked image.

Fix
---

- `prepare_dm_stanza`: exclude `AdminRevoke` from `hide_decrypt_fail`
  (matches the existing logic in `prepare_group_stanza`'s skmsg path).
- `prepare_group_stanza` SKDM path: compute `skdm_hide_decrypt_fail`
  with the same rule used for the main payload instead of hardcoding
  `true`. Other infrastructure messages (reactions, edits, pins)
  continue to hide decrypt failures as before — only `AdminRevoke`
  flips to `false`.
- `prepare_{group,dm}_retry_stanza`: accept an `edit:
  Option<EditAttribute>` parameter and emit `attr("edit", ...)` on
  the rebuilt `<message>` stanza when present.
- `EditAttribute::infer_from_message`: helper that recovers the wire
  `edit` value from a fully-constructed `wa::Message` (Revoke +
  `key.from_me` → Sender/AdminRevoke; pin / edited_message → matching
  variant). Used by the retry callers since the original stanza's
  `edit` attribute is not part of the protobuf payload that
  `add_recent_message` caches.
- `retry.rs`: infer `edit_attr` from `original_msg` and forward it
  to both retry builders.

Verified end-to-end against a live group: admin revoke now applies on
all recipient devices, including the ones that go through the retry
path because their Signal session needed a prekey bundle.
@Salientekill
Salientekill force-pushed the fix/admin-revoke-edit-preserved-and-no-decrypt-fail-hide branch from 5806e55 to 78b5e6c Compare May 12, 2026 22:55
@Salientekill

Copy link
Copy Markdown
Contributor Author

Round 3 applied in 78b5e6c:

Neutral wrappers now unwrapped before inference. infer_from_message calls send::unwrap_message first, so payloads nested inside ephemeral_message, view_once_message{,_v2,_v2_extension}, device_sent_message, document_with_caption_message, group_mentioned_message, bot_invoke_message, associated_child_message, or poll_creation_option_image_message are descended through before checking pin/edit/revoke fields.

unwrap_message was made pub (it intentionally does not include edited_message since that field is the signal we're trying to detect — calling get_base_message from MessageExt would have collapsed the edit envelope and broken detection).

Added regression test infer_from_message_unwraps_neutral_wrappers covering:

  • Admin revoke nested under ephemeral_message → returns AdminRevoke.
  • Pin nested through device_sent_message → view_once_message (double wrapping) → returns PinInChat.

Local: 690 tests passed, fmt clean.

Cleanup of the admin-revoke fix. Trim verbose doc/inline comments per project
style (no em dashes, no bug-history narration, no "what" tables). Narrow
unwrap_message visibility to pub(crate) since only intra-crate callers use it.
Drop the AdminEdit branch from infer_from_message: WAWebSendMsgCommonApi's
editAttribute always returns MESSAGE_EDIT for protocol_message.MessageEdit
regardless of from_me, and the divergent branch was untriggered in practice.

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

♻️ Duplicate comments (1)
wacore/src/types/message.rs (1)

125-126: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restore AdminEdit inference for protocol-message edits.

Line 125 collapses every ProtocolType::MessageEdit into MessageEdit, so cached admin edits retry without edit="3" and come back as plain resends. Use pm.key.from_me here the same way revoke already does, and lock it with the missing from_me = false regression test.

Suggested fix
-            if pm.r#type == Some(ProtocolType::MessageEdit as i32) || pm.edited_message.is_some() {
-                return Some(Self::MessageEdit);
+            if pm.r#type == Some(ProtocolType::MessageEdit as i32) {
+                let from_me = pm.key.as_ref().and_then(|k| k.from_me).unwrap_or(false);
+                return Some(if from_me {
+                    Self::MessageEdit
+                } else {
+                    Self::AdminEdit
+                });
+            }
+            if pm.edited_message.is_some() {
+                return Some(Self::MessageEdit);
             }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wacore/src/types/message.rs` around lines 125 - 126, The branch that treats
ProtocolType::MessageEdit and edited_message as plain MessageEdit must
distinguish sender like revoke does: when pm.r#type ==
Some(ProtocolType::MessageEdit as i32) || pm.edited_message.is_some(), check
pm.key.from_me and return Self::MessageEdit if from_me == true, otherwise return
Self::AdminEdit; update the logic in the function where pm.r#type,
pm.edited_message and Self::MessageEdit are handled and add/adjust a regression
test asserting that a protocol edit with pm.key.from_me == false is inferred as
AdminEdit (i.e. include from_me = false case).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@wacore/src/types/message.rs`:
- Around line 125-126: The branch that treats ProtocolType::MessageEdit and
edited_message as plain MessageEdit must distinguish sender like revoke does:
when pm.r#type == Some(ProtocolType::MessageEdit as i32) ||
pm.edited_message.is_some(), check pm.key.from_me and return Self::MessageEdit
if from_me == true, otherwise return Self::AdminEdit; update the logic in the
function where pm.r#type, pm.edited_message and Self::MessageEdit are handled
and add/adjust a regression test asserting that a protocol edit with
pm.key.from_me == false is inferred as AdminEdit (i.e. include from_me = false
case).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e76bb077-13b8-44ce-ab26-c8b319eba1cc

📥 Commits

Reviewing files that changed from the base of the PR and between 5806e55 and dd64315.

📒 Files selected for processing (3)
  • src/retry.rs
  • wacore/src/send.rs
  • wacore/src/types/message.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants