You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-02-01] [$500] IOU – The receipt route image is blank after adding a stop in offline mode #34287
Version Number: 1.4.24-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
changed the title [-] IOU – The receipt route image is blank after adding a stop in offline mode[/-][+][$500] IOU – The receipt route image is blank after adding a stop in offline mode[/+]on Jan 10, 2024
Please re-state the problem that we are trying to solve in this issue.
The pending distance request receipt is blank.
What is the root cause of that problem?
This started happening #33586 where we tried to define the local files instead of returning isLocalFile: true for all the receipts that didn't match the early-return criteria.
This particular issue is happening because after a distance request is modified, we are waiting for the BE response to generate a new map snapshot to be used as a thumbnail here, and we optimistically use the URL of an image that still has to be generated on the BE, as a receipt. It looks like a normal image URL, not a local file.
What changes do you think we should make in order to solve the problem?
This pending distance request case is quite unique. For this, we already check the Distance transaction to not be pending (not have pending waypoints) here:
We just need to add another check for the cases when the Distance request has a pending waypoint (the opposite check) and not wait until the final return, which will now return isLocalFile: false instead of true.
if(Object.hasOwn(transaction?.pendingFields??{},'waypoints')){return{thumbnail: null,image: ReceiptGeneric,isLocalFile: true};}else{if(hasEReceipt){return{thumbnail: null,image: ROUTES.ERECEIPT.getRoute(transaction.transactionID), transaction};}// For local files, we won't have a thumbnail yetif(isReceiptImage&&(path.startsWith('blob:')||path.startsWith('file:'))){return{thumbnail: null,image: path,isLocalFile: true};}if(isReceiptImage){return{thumbnail: `${path}.1024.jpg`,image: path};}}
What alternative solutions did you explore? (Optional)
we are returning the ReceiptGeneric thumbnail isLocalFile is not set to true as path is found from transaction?.receipt?.source which is not local so it will try to load it but fails as we are offline
What changes do you think we should make in order to solve the problem?
The right solution is to reset receipt of the transaction on saving waypoint in onyx b/c it is obsolate as we do for routes as in here
changed the title [-][$500] IOU – The receipt route image is blank after adding a stop in offline mode[/-][+][HOLD for payment 2024-02-01] [$500] IOU – The receipt route image is blank after adding a stop in offline mode[/+]on Jan 25, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.31-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
[@shubham1206agra] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@shubham1206agra] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@shubham1206agra] Determine if we should create a regression test for this bug.
[@shubham1206agra] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@shubham1206agra] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: Not required
[@shubham1206agra] Determine if we should create a regression test for this bug. No
[@shubham1206agra] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
[-] IOU – The receipt route image is blank after adding a stop in offline mode[/-][+][$500] IOU – The receipt route image is blank after adding a stop in offline mode[/+]melvin-bot commentedon Jan 10, 2024
Job added to Upwork: https://www.upwork.com/jobs/~0164c29443ff05e829
melvin-bot commentedon Jan 10, 2024
Triggered auto assignment to @kadiealexander (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jan 10, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (
External)paultsimura commentedon Jan 10, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The pending distance request receipt is blank.
What is the root cause of that problem?
This started happening #33586 where we tried to define the local files instead of returning
isLocalFile: truefor all the receipts that didn't match the early-return criteria.This particular issue is happening because after a distance request is modified, we are waiting for the BE response to generate a new map snapshot to be used as a thumbnail here, and we optimistically use the URL of an image that still has to be generated on the BE, as a receipt. It looks like a normal image URL, not a local file.
What changes do you think we should make in order to solve the problem?
This pending distance request case is quite unique. For this, we already check the Distance transaction to not be pending (not have pending waypoints) here:
App/src/libs/ReceiptUtils.ts
Lines 40 to 53 in d9e75d5
We just need to add another check for the cases when the Distance request has a pending waypoint (the opposite check) and not wait until the final return, which will now return
isLocalFile: falseinstead oftrue.What alternative solutions did you explore? (Optional)
FitseTLT commentedon Jan 10, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The receipt route image is blank after adding a stop in offline mode
What is the root cause of that problem?
When we update the waypoints we are not resetting the receipt on the transaction in onyx so it still exists so although in
App/src/libs/ReceiptUtils.ts
Lines 68 to 70 in 55746c7
we are returning the
ReceiptGenericthumbnailisLocalFileis not set to true aspathis found fromtransaction?.receipt?.sourcewhich is not local so it will try to load it but fails as we are offlineWhat changes do you think we should make in order to solve the problem?
The right solution is to reset receipt of the transaction on saving waypoint in onyx b/c it is obsolate as we do for routes as in here
App/src/libs/actions/Transaction.ts
Lines 73 to 79 in 55746c7
same as we are setting when creating a distance request
App/src/libs/actions/IOU.js
Lines 870 to 873 in 55746c7
What alternative solutions did you explore? (Optional)
shubham1206agra commentedon Jan 13, 2024
@paultsimura's proposal looks good to me.
🎀 👀 🎀 C+ Reviewed
melvin-bot commentedon Jan 13, 2024
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
7 remaining items
paultsimura commentedon Jan 16, 2024
Thanks. The PR is ready for review: #34604
[-][$500] IOU – The receipt route image is blank after adding a stop in offline mode[/-][+][HOLD for payment 2024-02-01] [$500] IOU – The receipt route image is blank after adding a stop in offline mode[/+]melvin-bot commentedon Jan 25, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 25, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.31-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-02-01. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 25, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
kadiealexander commentedon Feb 2, 2024
@shubham1206agra don't forget about the checklist please!
kadiealexander commentedon Feb 2, 2024
Payouts due:
Upwork job is here.
shubham1206agra commentedon Feb 2, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed: