-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix receipt disappears when dismissing distance editor after receipt is generated #51519
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides these two things, the code looks good and I think once the requested changes are addressed we'll be good to Approve -> Merge.
src/libs/actions/Transaction.ts
Outdated
} | ||
let command; | ||
switch (routeType) { | ||
case 'draft': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 hardcoded switch / case strings can be replaced with the variables you added in CONST, like you did here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ikevin127 done
@@ -78,7 +79,18 @@ function IOURequestStepDistance({ | |||
}, | |||
[optimisticWaypoints, transaction], | |||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
if (hasReceipt) { | |
receiptURIs = ReceiptUtils.getThumbnailAndImageURIs(updatedTransaction ?? transaction); | |
} |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 🚀
|
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
GetRouteForBackup
API, 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
transactionBackup
andtransaction
data 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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