Fix/70820/follow up#72200
Conversation
|
@linhvovan29546 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #72200 +/- ##
==========================================
+ Coverage 35.13% 35.52% +0.38%
==========================================
Files 3307 3330 +23
Lines 108351 109440 +1089
Branches 34619 35002 +383
==========================================
+ Hits 38069 38876 +807
- Misses 70096 70383 +287
+ Partials 186 181 -5
📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
|
Updated PR! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-12.at.10.56.07.movAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2025-10-12.at.10.48.05.moviOS: mWeb SafariScreen.Recording.2025-10-12.at.10.50.18.movMacOS: Chrome / SafariScreen.Recording.2025-10-12.at.10.19.53.movMacOS: DesktopScreen.Recording.2025-10-12.at.11.17.34.mov |
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [rest.onClose]); | ||
|
|
||
| // We need to pass stable version of the function to properly work in eventListener |
There was a problem hiding this comment.
Can you update this comment to explain "why" this is. Generally the rule of thumb for comments is "why" not "what". This comment is currently telling us what it is doing, but not really why. Why is this necessary for the function to work properly in the eventListener?
puneetlath
left a comment
There was a problem hiding this comment.
This is great, thanks!
|
✋ 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/puneetlath in version: 9.2.32-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.32-6 🚀
|
Explanation of Change
Follow up for #69781
We pass stable function to ensure that the event listener always calls the latest version of the onClose function without being affected by stale closures. By using a stable handler that references a mutable ref, we keep the listener constant while allowing its behavior to stay up to date.
Fixed Issues
$#69781
PROPOSAL:
Tests
Precondition: Have a Workspace with CAD currency
Test 1:
Test 2:
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
69781-android-native.1.mp4
Android: mWeb Chrome
69781-android-web.mp4
iOS: Native
69781-ios-native.1.mp4
iOS: mWeb Safari
69781-ios-web.1.mp4
MacOS: Chrome / Safari
69781-web.1.mp4
MacOS: Desktop
69781-desktop.1.mp4