Repository navigation
refactor: read src/pages/iou (2/3) Onyx data in event handlers with Onyx.get - #106705
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
20d5cc5 to
b0d5073
Compare
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot review |
|
Found one issue: [P2] Keep pagination flags subscribed — IOURequestEditReportCommon.tsx:510 FlashList can invoke No other actionable correctness findings. Static review only; web testing was not run. |
1ae6658 to
0ccedd7
Compare
|
@MelvinBot review Regarding onEndReached, I think it’s safe to read here. Nothing re-runs when these two flags change, because FlashList reads the latest onEndReached prop on each call and only re-checks bounds on its own renders and scrolls |
|
Your reasoning is sound: FlashList reads the current callback when checking bounds, and the handler reads both flags afresh. Their changes alone don’t trigger another check. I found no stale-read or feedback-loop regression, so I withdraw the P2 correctness finding. The remaining distinction is policy: ONYX-1 C1 still explicitly prohibits effect-reachable reads. This warrants a maintainer-approved exception or rule clarification—not a claim that restoring subscriptions fixes a demonstrated bug. No additional actionable correctness findings in the updated diff. Static review only. |
|
@MelvinBot test |
|
🤖 Web test steps verification results: Verified manual distance confirmation, existing merchant update, and category-upgrade navigation on dev NewDot web. The tester reached its execution limit; remaining checks were unverified or lacked prerequisites.
|
…n the Upgrade step
0ccedd7 to
641d1ca
Compare
|
This PR adds a new |
|
@aimane-chnaif |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safaritest1.movtest2.mov |
mountiny
left a comment
There was a problem hiding this comment.
Seems like others already approved so we can move it ahead
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 mountiny 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.53-0 🚀
|
|
No help site update needed — this PR refactors internal data reads without adding features, changing user-facing workflows or labels, removing beta gates, or making existing article instructions incorrect. |
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.5.53-3 🚀
Bundle Size Analysis (Sentry): |
1 similar comment
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.5.53-3 🚀
Bundle Size Analysis (Sentry): |



Explanation of Change
Part of the
useOnyxtoOnyx.get/Onyx.multiGetmigration (Phase 1,src/pages/iou2 of 3).These 8 IOU files subscribed with
useOnyxto 43 values that only an event handler reads (a row select, a form submit or a button press). Each subscription re-rendered the page when its key changed, though nothing on screen used the value. This PR deletes them. Each handler path now reads its values once, withOnyx.getor oneOnyx.multiGetand a literal key list. Policy categories and tags are read the same way, with keys built inside the handler from the currentpolicyorreport. Values that had a selector (introSelected, draft transaction IDs, onboarding) get the same selector applied after the read.What changes in each handler:
asyncand reads after any synchronous guard or early return. When only one branch needs a value, the read is in that branch, so the other paths stay synchronous. That covers the start-page check on the destination step, the edit, split-edit and create paths of manual distance (each reads only its own keys), the edit branch of merchant, tax amount and distance rate, and the bulk move after an upgrade. On the distance rate step,RULEis read in the tax branch and again with the other keys in the edit branch.void | Promise<void>:FormonSubmit,SelectionListonSelectRow,AddressSearchonPress, the amount form, the destination and upgrade components, and thedismissKeyboardAndExecutecallback.multiGet, soconciergeReportIDstays onuseOnyxto build its key.useOnyx, because FlashList also callsonEndReachedfrom a post-render effect (ONYX-1 section C).Bindings that remain on
useOnyxare used in render or read a key thatOnyx.getdoes not allow (policy_,report_,reportActions_andtransactionViolations_).IOURequestEditReportCommonTestandIOURequestStepReportTestwait for batched updates after selecting a report, because the selection now runs after the read. Three test mocks that forwardonSelectRoworonSubmitinto a nativeonPressuse a block arrow, so the mockedonPressstays void.Fixed Issues
$ #101910
PROPOSAL: N/A
Tests
Test 1: Per diem destination
Test 2: Manual distance
Test 3: Distance rate and merchant
Test 4: Upgrade from a track expense
Test 5: Bulk move through the upgrade
Test 6: Waypoint
Test 7: Edit report
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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.mov
Android: mWeb Chrome
android.web.4.mov
android.web.5.mov
android.web.6.mov
android.web.mov
iOS: Native
ios.1-3.mov
ios.6-7.mov
iOS: mWeb Safari
ios.web.mov
MacOS: Chrome / Safari
web.1-3.mov
web.4-5.mov
web.6.mov
web.7.mov