fix: correctly resolve mention whispers created during message edits#86264
fix: correctly resolve mention whispers created during message edits#86264youssef-lr merged 7 commits intomainfrom
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❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
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. |
|
https://github.com/Expensify/Auth/pull/20622 has been merged and deployed, so I'm taking this one off hold. |
|
Will start reviewing shortly |
|
@deetergp The Repro: Send a message with a mention, edit to add a second mention, delete the message. The first whisper disappears instantly, the second one lingers until the backend responds. In offline mode, the second whisper stays indefinitely. Monosnap.screencast.2026-04-09.10-14-46.mp4 |
|
@Krishna2323 Nice catch! Updated and verified that both are deleted in, regardless of connection status. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_hybrid.mp4Android: mWeb Chromeandroid_mWeb.mp4iOS: HybridAppios_hybrid.mp4iOS: mWeb Safariios_mWeb.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
|
@youssef-lr friendly bump for final review! @deetergp please merge main when you get a chance. Thanks! |
|
@youssef-lr Bump! |
|
🚧 @youssef-lr has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.3.60-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR. They are purely internal bug fixes to how actionable mention whispers resolve their parent actions — specifically adding a These changes don't affect any user-facing behavior, UI labels, feature names, settings, or workflows. The existing help site article on mentions ( No help site documentation changes are required. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.60-22 🚀
|
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