-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2024-06-03] [$500] mWeb - Attachment - "Failed to load PDF file" message only appears if I swipe the chat #32109
Comments
Job added to Upwork: https://www.upwork.com/jobs/~016eebac1c88fbedc0 |
Triggered auto assignment to @johncschuster ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat ( |
@kbecciv can you please add the pdf file with which this is reproducable ? |
@ishpaul777 Sure, added under action performed. |
Thanks! @kbecciv |
ProposalPlease re-state the problem that we are trying to solve in this issue.When uploading a corrupted PDF, the chat view will render an empty view (which takes up the entire screen), until an action/re-render is done such as scrolling up or clicking the text). This issue arises in the native iOS and Android platform (the provided video in OP was also in the native app also). What is the root cause of that problem?There is a state management issue in the native PDFView component. The state variables What changes do you think we should make in order to solve the problem?I will first attempt to debug which state variables are changing when, then make the appropriate changes to ensure that it shows "Failed to load PDF file" without you having to do any actions. This implementation of state variables for PDF load (excluding PDFs with passwords) relies on 3 conditions, whether it is OK to load, already failed, and if it's loading. I will see if simplifying these solves the problem. |
ProposalPlease re-state the problem that we are trying to solve in this issue."Failed to load PDF file" message only appears if I swipe the chat. An empty space blocks the view. What is the root cause of that problem?Why doesn't this issue occur with correctPDF or PDF with password?
In here, we'll be showing the PDF loading state while we're trying to load the corrupted PDF. This PDF loading is supposed to be for the Attachment modal, which uses full screen height here. This causes the large blank space with activity indicator to appear when the corrupted PDF is being loaded, and after the loading failure, it will show the What changes do you think we should make in order to solve the problem?Solution 1: Invisible loading The blank space loading with indicator should not be there, because it's inconsistent with other PDF types (correct PDF, PDF with password) which doesn't have any loading We should disable it by passing a flag
AttachmentView > AttachmentViewPdf > PDFView If the flag is true, we set the height of the Update this line to
ResultScreen.Recording.2023-11-29.at.16.42.20.movSolution 2: Visible loading Because the current height of loading is set to screenHeight > AUTOSCROLL_TO_TOP_THRESHOLD (128px), so the list is not scrolled to bottom when the PDF is failed. So we need to adjust the height here to be less than AUTOSCROLL_TO_TOP_THRESHOLD, we just do it if it is report action, otherwise we need to show the full screen loading (view full pdf document). For example, we can set 100px, if we want to increase the loading height, we have to increase AUTOSCROLL_TO_TOP_THRESHOLD as well ResultScreen.Recording.2023-12-25.at.13.48.29.movWhat alternative solutions did you explore? (Optional) |
ProposalProblemFailed to load PDF file" message only appears if I swipe the chat Root CauseThis happens because we set the width and height to equal to window height for Pdf View and when the Pdf view unmounte on error in Pdf loading the inverted flatlist fails to scroll down for the bottom most item(the pdf attachment) size change (this doesn't happen when we quicky sends a message when uploading of pdf is in progress) Changes SuggestedAt present, the loading indicator takes full window height when pdf is loading and is not consistent with the image loading style, also when we click the "failed to load" it downloads the pdf but user has no idea why attachment is downloaded (there is no indication that clicking the message download the file) for better UX we will use the loading indicatior in a box like image loading, and Summary of Solution:
Code Changes Details:
Apply below changes only
To render Fallback Icon-
App/src/components/PDFView/index.native.js Lines 150 to 152 in b74be72
App/src/components/PDFView/index.js Lines 286 to 287 in b74be72
POC - Screen.Recording.2023-12-01.at.4.24.36.AM.mov |
Reviewing... |
So We do want the loader to stay. There is also a loader for correct PDFs/images. So the issue should be fixed via styles. @tienifr Can you please update your proposal to mention what styles and where? @ishpaul777 Good find. But Can you please do an impact analysis on your proposal and provide results on various involved UI parts?
Good plan in the alternative idea but we don't want to show the error in the box equal to the normal image attachment height. let's just show this as a normal file.
How? |
I am withdrawing my initial proposal as i am unable to dig for the why adding Still standing with alternative solution (updated) test brach may help to review changes better |
@parasharrajat I just added the implementation detail to my proposal |
@parasharrajat, can you review @tienifr's proposal when you get a moment? Thank you! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
I will review the changes in 12hours. Gotta go somewhere. |
@parasharrajat bump! Can you review the changes when you get a moment? |
@shawnborton @dannymcclain Which one is decided 🤔 |
^^ That sounds good, let's do it. |
@yuwenmemon Could you please help review Expensify/react-fast-pdf#17 PR on react-fast-pdf repo? |
Bump @yuwenmemon for Expensify/react-fast-pdf#17 |
Merged! |
This issue has not been updated in over 15 days. @yuwenmemon, @johncschuster, @parasharrajat, @ishpaul777 eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Waiting on version bump for |
PR is merged. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.75-1 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-06-03. 🎊 For reference, here are some details about the assignees on 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:
|
Payment SummaryC+ Reviewer: @parasharrajat - $500 - paid via Manual Requests |
I have issued payment to @ishpaul777 via Upwork 🎉 @parasharrajat / @ishpaul777 can you complete the BZ Checklist above? |
I couldn't figure out the PR responsible for the issue. I would love some help here. In the meantime, I am adding the checklist as I don't think that we should block this for the root cause PR. |
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:
Regression Test Steps
Do you agree 👍 or 👎 ? |
Thanks for the regression test steps, @parasharrajat! Please send your Manual Request for payment (summary above) |
Payment requested as per #32109 (comment) |
$500 approved for @parasharrajat |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.4.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:
Action Performed:
PDF file
Corrupted PDF.pdf
Expected Result:
"Failed to load PDF file" should be visible without taking any actions.
Actual Result:
"Failed to load PDF file" message only appears if I swipe the chat. An empty space blocks the view.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6293097_1701173560223.Tbxn2307.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @johncschusterThe text was updated successfully, but these errors were encountered: