Fix #83751: prevent overwriting active transaction IDs on referential re-renders#83772
Fix #83751: prevent overwriting active transaction IDs on referential re-renders#83772
Conversation
…-renders
The split effects allowed the set-effect to fire on referential-only
changes of visualOrderTransactionIDs. When navigating from Review
Duplicates to SEARCH_REPORT, this overwrote the IDs set by
onPreviewPressed, causing wrong prev/next arrow state on first open.
Replace with a combined effect using a join(',') primitive key as the
dependency. The effect only re-fires when the array content actually
changes, matching the original useDeepCompareRef behavior without the
deep-equal overhead or React Compiler incompatibility.
Made-with: Cursor
|
@ChavdaSachin 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] |
Made-with: Cursor
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-04.at.8.28.54.PM.movAndroid: mWeb ChromeScreen.Recording.2026-03-04.at.8.34.17.PM.moviOS: HybridAppScreen.Recording.2026-03-04.at.7.52.42.PM.moviOS: mWeb SafariScreen.Recording.2026-03-04.at.7.57.17.PM.movMacOS: Chrome / SafariScreen.Recording.2026-03-04.at.7.07.31.PM.mov |
|
🚧 @Gonals has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Gonals in version: 9.3.32-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.32-3 🚀
|
Explanation of Change
Fixes a regression from #83432 where navigating from "Review Duplicates" to
SEARCH_REPORTcaused wrong prev/next arrow state on first open.Root cause: After removing
useDeepCompareRef, the effect inMoneyRequestReportTransactionListusedvisualOrderTransactionIDsdirectly as its dependency. When navigating toSEARCH_REPORT, Onyx data loads triggereduseMemorecomputation, producing a new array reference with the same (or slightly different) content. This caused the effect to re-fire and overwrite the transaction IDs set byTransactionDuplicateReview.onPreviewPressed, placing the clicked transaction at the wrong position in the list.Fix: Use a
join(',')primitive string key as the effect dependency. The effect only re-fires when the array content actually changes, matching the originaluseDeepCompareRefbehavior without the deep-equal overhead or React Compiler incompatibility. The idempotent guard insetActiveTransactionIDsstays as a defense-in-depth layer.Fixed Issues
$ #83751
Tests
Offline tests
QA Steps
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