Repository navigation
Fix receipt disappears when dismissing distance editor after receipt is generated - #51519
Conversation
…x/48630-calculate-route-for-pending-trx-backup
…x/48630-calculate-route-for-pending-trx-backup
…port when backup restored
|
@ikevin127 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] |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.webmAndroid: mWeb Chromeandroid-mweb.webmiOS: Nativeios.mp4iOS: mWeb Safariios-mweb.1.mp4MacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
ikevin127
left a comment
There was a problem hiding this comment.
Besides these two things, the code looks good and I think once the requested changes are addressed we'll be good to Approve -> Merge.
| } | ||
| let command; | ||
| switch (routeType) { | ||
| case 'draft': |
There was a problem hiding this comment.
These 3 hardcoded switch / case strings can be replaced with the variables you added in CONST, like you did here.
| @@ -78,7 +79,18 @@ function IOURequestStepDistance({ | |||
| }, | |||
| [optimisticWaypoints, transaction], | |||
| ); | |||
There was a problem hiding this comment.
@wildan-m
issue.mov
I'm pretty sure that this will be reported as regression if we ship it this way, because since we fixed the issue in the sense that the map does show up now when dismissing the RHP, we now have that flicker map reset / reload on first time RHP dismissal.
Please look into this and see if you can figure out a way to not have the report map reset / reload when the RHP is dismissed for the first time and instead keep it the way it looks when it loads for the first time while RHP is still open if possible.
There was a problem hiding this comment.
@ikevin127 After further investigation, this issue related to my previous mentioned issue #48630 (comment) where transactionBackup is not exactly the same with unmodified transaction data.
For instance, in backup, the pendingFields is not removed, this will cause incorrect result here:
App/src/components/ReportActionItem/MoneyRequestView.tsx
Lines 258 to 260 in 652d2ff
I think the only way to resolve that flicker issue and other fields flicker is to make the backup data exactly the same with unmodified transaction data when they are online, and it will require BE change.
@Gonals is it possible that when we call GetRouteForBackup we also get the same unmodified transaction data when they are online?
The missing fields can be seen in previous comment #48630 (comment)
There was a problem hiding this comment.
I found another issue where the generated map is not clickable due to pendingFields and pendingAction not being removed. Making transactionBackup identical to unmodified transaction when online is crucial to prevent flickering and an unclickable map, but I'm unsure if this is possible from the backend perspective.
There was a problem hiding this comment.
I think this has a different root cause, right? Since it requires BE changes, I think it is a different bug
There was a problem hiding this comment.
I think this has a different root cause, right? Since it requires BE changes, I think it is a different bug
@Gonals I agree that flickering is not directly related to the original issue and fixing it is not straightforward.
|
@wildan-m Please address the requested change in #51519 (comment), after which I will 🟢 Approve and defer to Gonals regarding issue mentioned in #51519 (comment) and whether or not we cah ship it like this and not get penalty in case it's reported as regression post-merge. |
…x/48630-calculate-route-for-pending-trx-backup
There was a problem hiding this comment.
Looks good to me!
Note: Failing jest test seems unrelated (timeout).
|
@ikevin127 please check this commit 198ccb3 That change will resolve map not clickable issue. |
|
@wildan-m Thanks for that additional fix, looks good to me! 🚀 Approved once again, and now passing it to @Gonals for final review. Caution Please consider issue mentioned in #51519 (comment) and whether or not we cah ship it like this and not get a regression penalty in case it will be reported as regression post-merge. |
|
@Gonals looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
No emergency. The linter was complaining about files that were not modified using withOnyx |
|
✋ 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/Gonals in version: 9.0.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.56-9 🚀
|
| // If the user opens IOURequestStepDistance in offline mode and then goes online, re-open the report to fill in missing fields from the transaction backup | ||
| if (!transaction?.reportID) { | ||
| return; | ||
| } | ||
| Report.openReport(transaction?.reportID); |
There was a problem hiding this comment.
FYI, we only need to call the openReport API if transactionBackup does not have the route.
Details
This PR will fix receipt disappears when dismissing distance editor after receipt is generated
Fixed Issues
$ #48630
PROPOSAL: #48630 (comment)
Tests
Note
When using a local server, make sure to switch the BE to staging on the Troubleshooting page to access the
GetRouteForBackupAPI, which is not yet available in dev.There are known issues after this PR applied map and some other fields will be flickered for a brief moment
The issues arise due to discrepancies between the
transactionBackupandtransactiondata during online updates. Additional BE changes are needed to address this. Related commentOffline 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-26.at.16.04.29.mp4
Android: mWeb Chrome
Kapture.2024-10-26.at.16.28.52.mp4
iOS: Native
Kapture.2024-10-26.at.15.49.12.mp4
iOS: mWeb Safari
Kapture.2024-10-26.at.15.57.56.mp4
MacOS: Chrome / Safari
Kapture.2024-10-26.at.14.09.13.mp4
MacOS: Desktop
Kapture.2024-10-26.at.16.07.27.mp4