Remove invalid recent waypoint when creating / editing distance request#50323
Conversation
…x/48631-remove-invalid-recent-waypoint
…x/48631-remove-invalid-recent-waypoint
|
@suneox @neil-marcellini I use |
|
@wildan-m As mentioned earlier, we also need to handle TrackExpense case Screen.Recording.2024-10-07.at.22.09.39.mp4 |
…x/48631-remove-invalid-recent-waypoint
|
@suneox nice catch! the track expense part has been resolved |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariTrack expense: Screen.Recording.2024-10-08.at.21.18.35.mp4Edit expense: Screen.Recording.2024-10-08.at.20.51.18.mp4Submit expense Screen.Recording.2024-10-08.at.21.23.03.mp4MacOS: DesktopScreen.Recording.2024-10-08.at.21.25.18.mp4Android: NativeScreen.Recording.2024-10-08.at.21.40.27.mp4Android: mWeb ChromeScreen.Recording.2024-10-08.at.21.37.57.mp4iOS: NativeScreen.Recording.2024-10-08.at.21.28.11.mp4iOS: mWeb SafariScreen.Recording.2024-10-08.at.21.35.18.mp4 |
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks great, thank you!
| * @param waypoints - The collection of waypoints to sanitize. | ||
| * @returns The sanitized collection of waypoints. | ||
| */ | ||
| function sanitizeRecentWaypoints(waypoints: WaypointCollection): WaypointCollection { |
There was a problem hiding this comment.
Why do we need to do this?
There was a problem hiding this comment.
Ah I see, the backend saves the waypoints as is, and we don't want to save the pendingAction property. I'm good with this then.
|
✋ 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/neil-marcellini in version: 9.0.47-1 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.47-4 🚀
|
| const {pendingAction, ...rest} = waypoint as RecentWaypoint; | ||
| acc[key] = rest; | ||
| return acc; | ||
| }, {} as WaypointCollection); |
There was a problem hiding this comment.
There was no need for casting here, the reducer function just needed the type declared:
(acc: WaypointCollection, [key, waypoint]) => {...}
then the cast is not needed
Details
The PR will fix invalid waypoints aren't cleared when a request fails
Fixed Issues
$ #48631
PROPOSAL: #48631 (comment)
Tests
Offline tests
Same as test
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Kapture.2024-10-07.at.13.09.52.mp4
Android: mWeb Chrome
Kapture.2024-10-07.at.13.15.30.mp4
iOS: Native
Kapture.2024-10-07.at.12.57.39.mp4
iOS: mWeb Safari
Kapture.2024-10-07.at.13.05.33.mp4
MacOS: Chrome / Safari
Kapture.2024-10-07.at.11.12.26.mp4
MacOS: Desktop
Kapture.2024-10-07.at.13.18.32.mp4