[HOLD Auth #20622] fix: correctly resolve mention whispers created during message edits#86264
[HOLD Auth #20622] fix: correctly resolve mention whispers created during message edits#86264
Conversation
When a message is edited to add a new @mention, the backend creates a second ACTIONABLEMENTIONWHISPER with a random ID (not following the parentID+1 convention). When that parent comment is deleted, the backend now stores the parent's reportActionID in the whisper's originalMessage. Update isResolvedActionableWhisper to use this stored reportActionID (when present) to find the parent, falling back to offset arithmetic for legacy whispers that predate this field. Add reportActionID to the OriginalMessageActionableMentionWhisper type accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@youssef-lr Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21ea5cd2ee
ℹ️ 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".
The backend stores the parent comment's reportActionID as a JSON string (to avoid precision loss when parsed by JavaScript). Update the TypeScript type and remove the String() wrapper since the value is already a string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Will start reviewing shortly. |
|
You should hold off @Krishna2323 as it requires a yet-to-be-approved backend change in order to work. |
Explanation of Change
When a message is edited to add a new @mention, the backend creates a second
ACTIONABLEMENTIONWHISPERwith a random ID (not following theparentID+1convention used for whispers created on initial send). When that parent comment is deleted, the backend cascades the deletion to all linked whispers.The backend (Auth fix for issue #86084) now stores the parent comment's
reportActionIDin the whisper'soriginalMessageJSON. This PR updates the frontend to use that field.Without this fix:
isResolvedActionableWhisperuses offset arithmetic (whisperID - 1) to find the parent of a mention whisper. For edit-created whispers with random IDs, this points to the wrong action. If that wrong action is not deleted, the function returnsfalseand the whisper stays visible even after the backend deleted it.With this fix: When
originalMessage.reportActionIDis present, use it directly to find the parent. Fall back to offset arithmetic for legacy whispers that predate this field.Fixed Issues
$ #86084
Tests
Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
🤖 Generated with Claude Code