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-04-05] [$500] Android - if you go offline, create a manual request and upload a receipt, and go online, the receipt disappears #38224
Version Number: 1.4.51 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:
Action Performed:
Go offline
Upload the PDF receipt
Open the PDF receipt preview. It will show the local PDF file
Go online
Wait for a few seconds (~20-30 seconds) until the upload completes. It will try to show the uploaded remote PDF file
But fails, so you will see Failed to load PDF
Expected Result:
When user taps receipt, the pdf file must be displayed without any error
Actual Result:
When you come back online, the receipt disappears or generates an error
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@jliexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Please re-state the problem that we are trying to solve in this issue.
Failed to load PDF shows while previewing a recently uploaded PDF as a receipt.
What is the root cause of that problem?
When we first preview the PDF receipt, it's still a local file. isAuthTokenRequired is false in this case. When the API to add the receipt completes, the receipt source is updated to the remote file. This will update both source and isAuthTokenRequired props.
You can use any PDF and please try to open the preview right after you upload it. This way, you will see the PDF preview of the local file. After the API completes, BE will return the remote file of the PDF and the app fails to switch to the remote file preview.
At this point, after discussing with @francoisl I am inclined to close this. @lanitochka17 please confirm if this issue is occurring with a specific PDF. @bernhardoj - same with you: if you can share your PDF, I can re-test.
changed the title [-][$500] Android - if you go offline, create a manual request and upload a receipt, and go online, the receipt disappears[/-][+][HOLD for payment 2024-04-05] [$500] Android - if you go offline, create a manual request and upload a receipt, and go online, the receipt disappears[/+]on Mar 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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:
[@cubuspl42] The PR that introduced the bug has been identified. Link to the PR:
[@cubuspl42] 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:
[@cubuspl42] 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:
[@cubuspl42] Determine if we should create a regression test for this bug.
[@cubuspl42] 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.
[@jliexpensify / @kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The PR that introduced the bug has been identified. Link to the PR:
It seems that the bug was present in the relevant components since they were created
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:
N/A
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:
No need for additional discussion
Determine if we should create a regression test for this bug.
Up to the QA team
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.
Create a manual request.
Open the request transaction thread.
Switch to offline mode.
Add a PDF receipt.
Click on the receipt preview to open the attachment page.
Return to online mode.
Wait for a few seconds until the attachment reloads.
Ensure the PDF receipt is properly displayed, and not the "Failed to load PDF" message.
Activity
melvin-bot commentedon Mar 13, 2024
Triggered auto assignment to @jliexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.lanitochka17 commentedon Mar 13, 2024
@jliexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
bernhardoj commentedon Mar 13, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Failed to load PDF shows while previewing a recently uploaded PDF as a receipt.
What is the root cause of that problem?
When we first preview the PDF receipt, it's still a local file.
isAuthTokenRequiredis false in this case. When the API to add the receipt completes, the receipt source is updated to the remote file. This will update bothsourceandisAuthTokenRequiredprops.App/src/pages/TransactionReceiptPage.tsx
Lines 49 to 51 in fa6bcc0
Then, we pass it to the attachment view.
App/src/components/AttachmentModal.tsx
Lines 548 to 552 in fa6bcc0
The problem is, the source is coming from the source state
App/src/components/AttachmentModal.tsx
Line 416 in fa6bcc0
which is updated every time the
sourceprops is updated.App/src/components/AttachmentModal.tsx
Lines 408 to 410 in fa6bcc0
So, the
isAuthTokenRequiredis already true, but the source is still local file because the state is not updated yet. That's why the error appears.What changes do you think we should make in order to solve the problem?
Instead of passing the
isAuthTokenRequiredprops, we can passisAuthTokenRequiredStatewhich is also updated every time the props change.App/src/components/AttachmentModal.tsx
Lines 412 to 414 in fa6bcc0
What alternative solutions did you explore? (Optional)
Prioritize the source props instead of source state
App/src/components/AttachmentModal.tsx
Line 416 in fa6bcc0
jliexpensify commentedon Mar 14, 2024
PDF attachments are working perfectly for me on v1.4.51-3 (Pixel 3a)
@lanitochka17 Please re-test this
jliexpensify commentedon Mar 14, 2024
@bernhardoj also if you could retest and share a video, that would be great too!
bernhardoj commentedon Mar 14, 2024
Sure, here is the video.
Screen.Recording.2024-03-14.at.18.57.05.mov
You can use any PDF and please try to open the preview right after you upload it. This way, you will see the PDF preview of the local file. After the API completes, BE will return the remote file of the PDF and the app fails to switch to the remote file preview.
jliexpensify commentedon Mar 14, 2024
Hmm that's not what I'm seeing on a real device, on the newest version of production. Do you have a physical device for testing this one?
bernhardoj commentedon Mar 14, 2024
Same.
Screenrecorder-2024-03-14-19-56-40-704.1.mp4
Just to make sure, you are previewing the PDF receipt right? (not the regular chat attachment)
jliexpensify commentedon Mar 14, 2024
@lanitochka17 - you say this:
But there's no PDF in the GH?
@bernhardoj - are you using any random PDF? Because I am, so just wondering if it's a specific to a PDF?
francoisl commentedon Mar 14, 2024
I can't repro either on a Pixel 6 (app v 1.4.52-5), tested with 2 different random PDFs.
jliexpensify commentedon Mar 14, 2024
At this point, after discussing with @francoisl I am inclined to close this. @lanitochka17 please confirm if this issue is occurring with a specific PDF. @bernhardoj - same with you: if you can share your PDF, I can re-test.
55 remaining items
[-][$500] Android - if you go offline, create a manual request and upload a receipt, and go online, the receipt disappears[/-][+][HOLD for payment 2024-04-05] [$500] Android - if you go offline, create a manual request and upload a receipt, and go online, the receipt disappears[/+]melvin-bot commentedon Mar 29, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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-04-05. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 29, 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:
jliexpensify commentedon Mar 31, 2024
Back, removing Kadie!
jakub-trzebiatowski commentedon Apr 5, 2024
jliexpensify commentedon Apr 5, 2024
Dammit Upworks closed the job.
PAYMENT SUMMARY
NEW Upwork job - please accept!
jliexpensify commentedon Apr 8, 2024
Bump @cubuspl42 to accept so I can pay everyone please.
jakub-trzebiatowski commentedon Apr 8, 2024
@jliexpensify Accepted 👍
jliexpensify commentedon Apr 8, 2024
Paid and job closed!