refactor: isolate saveWaypoint from Onyx.connect data#72770
Conversation
…nnect/saveWaypoint-src-libs-actions-Transaction.ts
Codecov Report❌ Patch coverage is
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
@DylanDylann @tgolen One of you needs to 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] |
|
@DylanDylann This is waiting on you to do the reviewer checklist. |
|
I am reviewing |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2025-10-28.at.23.10.53.movAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
| if (!allRecentWaypoints) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
If this happens, users might experience an issue where clicking the save button and nothing happens. So I think this code doesn’t make sense. @tgolen What do you think?
There was a problem hiding this comment.
Yeah, that doesn't sound good. This would be the case for any brand new account that is just using this for the first time, right? So, they would be in a case where they have no recent waypoints.
There was a problem hiding this comment.
I think we can default it to an empty object instead of returning early like this.
|
The rest looks fine to me |
…nnect/saveWaypoint-src-libs-actions-Transaction.ts
|
This PR picked up some conflicts |
|
Bump @Skalakid to fix conflicts then this can be merged |
…nnect/saveWaypoint-src-libs-actions-Transaction.ts
|
@tgolen fixed! |
|
✋ 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/tgolen in version: 9.2.42-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.42-11 🚀
|
Explanation of Change
This PR is part of a refactor to remove Onyx.connect for the key:
ONYXKEYS.NVP_RECENT_WAYPOINTSfrom thesrc/libs/actions/Transaction.tsfile and replace it with useOnyx.It isolates the
saveWaypointfunction from the Onyx.connect data.To ensure this refactor doesn't break anything, it adds automated tests to the
saveWaypointfunction.Fixed Issues
$ #67775
PROPOSAL:
Tests
+button in the left bottom cornerTrack distanceoption+button in the left bottom cornerTrack distanceoptionStartand then press on the input and verify if previously entered destinations are listed asRecentOffline tests
Same as Tests
QA Steps
Same as Tests
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
waypoints_web.mov