-
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
[C+ Checklist Needs Completion] [$500] "Failed to load PDF file" message is not rendering in message preview #35808
Comments
Job added to Upwork: https://www.upwork.com/jobs/~0163673ea563ca697f |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha ( |
Triggered auto assignment to @greg-schroeder ( |
Can you try reproducing with this one Corrupted.PDF.pdf |
ProposalPlease re-state the problem that we are trying to solve in this issue."Failed to load PDF file" message is not rendering in message preview. What is the root cause of that problem?Three is a issue with mention file here. It seems there is an issue with the provided file (index.android.js) where the PDF content is still being rendered even when What changes do you think we should make in order to solve the problem?To address this issue, you can modify the code to check for the null value of
include components on top of the function
and mention below const variable on line#20
What alternative solutions did you explore? (Optional)You can remove the style [this.props.themeStyles.flexRow] from here Screenshots: |
ProposalPlease re-state the problem that we are trying to solve in this issueWhen successfully uploading a corrupt PDF file, the message is not being rendered in the message preview. What is the root cause of that problem?Note The issue is happening on botn iOS / Android native platforms. We don't see anything on native platforms but we see "Failed to load PDF file." on web. The difference between the native / web platforms is that on native we're applying different styles to the child container View that's rendered within the Pressable when an error exists. Where is the problem exactly ? If we take a look within the PDFView/index.native.js we can see that the Pressable that wraps the While the container View rendered by renderPDFView has the following styles applied when the error is being rendered: These styles have a conflict which make the error View invisible due to the following reasons:
Together, these styles result in the container Without an explicit height (or minimum height), the container Important All platforms (web / native) DO render the "Failed to load PDF file." from a code POV but we're not seeing it on native due to the conflicting styles. What changes do you think we should make in order to solve the problem?App/src/components/PDFView/index.native.js Line 188 in 06c7dac
In order to make sure, as mentioned in the RCA that the Pressable's children -> the container View takes up space along the vertical axis as well since This is the only way to have both the error comment and the error within the attachment modal render correctly, without affecting the Pressable styles when the error is not present, by keeping the Changed code: style={[themeStyles.flex1, themeStyles.alignSelfStretch, !failedToLoadPDF && themeStyles.flexRow]} VideosAndroid: NativeScreen.Recording.2024-02-19.at.14.58.35.mov |
Reviewing proposals, i will update today. |
Note @kaushiktd Updated their proposal using the styles solution suggested by me after my proposal was posted - without calling it out in an Updated proposal comment ✌️ |
@ikevin127 That was my optional solution, and unlike your idea, you are removing all styles properties, whilst I am removing only one stylesheet. Also, my principal solution differed from yours. |
|
Looks like I pressed the nerve point! I knew about the styles so don't jump around to conclusions. Cintributors can see the proposals so let's leave on them. Besides I have a feeling that this issues is going to be auto close soon. About the targeting android, I know it also happens in iOS but the issue suggests this is for android so I prefer to do iOS part when the same issue will be reposted in iOS, separately. If contributor has checked iOS as platform , I would have done that as well. So I would rather do it separately instead doing double job in one payment. |
Which style property is causing the text to disappear, and any explanation why? |
This comment was marked as outdated.
This comment was marked as outdated.
@getusha Styles properties are not the main cause of this issue. When uploading a corrupted PDF file, the backend will attempt to generate an image preview for the PDF. However, if the PDF is corrupted, it won't be converted to an image and will remain in the link tag. In the existing code, there is no context to check whether the preview is available or not on the native side. Therefore, you must check whether the preview is available or not, as mentioned in my proposal. In addition, if you want to bypass all the check processes, you can remove the In current Expensify code, the However, when using If you want to horizontally center the Text component within the row, you should either remove |
Thanks everyone for the explanation, i think it makes sense to add the condition as @kaushiktd mentioned. will continue testing and i'll update. |
Updated proposal
@getusha Not sure how you arrived to that conclusion 👀 because:
Because it's not an actual fix since the root cause is not understood and the solution redundantly copies a block of code which already exists within PDFView and replaces the Note: This goes against our Contributing Guideline, precisely the DRY principle. Note The Again: this is a simple styling conflict issue, as mentioned in my proposal - has nothing to do with the error View not being rendered - it is rendered, it's just not visible because of the styles. See the updated proposal for more details. I think somebody from Expensify should take a look at the current state of this issue because with statements like:
especially that last sentence, I don't like where this is going 😅 |
Consider me a friend while I say this, but don't push this, my dear fellow! The way you phrase this sounds like you're accusing them of not knowing what they're doing. They are "assignees" for a reason. Also, it makes no difference to me or the contributors where my last sentences end because I had a conversation on Slack when I was in a similar circumstance. Since they discontinued bug reporting and made it purely internal, there is no purpose in registering the identical bug on iOS for this. They are coders, so if they believe this should also be done in iOS, they will let us know in a separate job. As of now only ANDROD is check marked. It is common sense for me that any bug reported for android, I should check them in iOS. I knew that. Stop assuming they are ignoring your suggestion or favoring mine and making such long comments. They inspect everything. Just because they do not put their views about every proposal, does not mean they do not check each comment here. Trust the process. They will make right decision. |
Don't push what exactly ? If you don't mind me asking. Just because whomever reported this bug did not check on iOS, that doesn't mean we should completely ignore the fact that this happens on iOS and disregard the guidelines for a quick pay, regardless of making a dent within the codebase.
That's partly true and shouldn't always be taken as absolute truth as based on recent events I can say that that's not always the case. Take this issue as an example. As you can see from the mentioned issue, the reviewer already made their decision but upon further review from an Expensify team member, the decision was to go with the correct RCA and solution which was best for the codebase and I think we're dealing with the same situation here. We have to acknowledge that sometimes the reviewer doesn't have as deep of an understanding of an issue as a Contributor that spend 1-2 hours debugging that issue has when it comes to the code involved. That's completely fine, but that doesn't mean I won't do anything in my power to bring that to their attention - especially when it comes to keeping the codebase clean. I understand that some Contributors might have other motivations than keeping the codebase clean and adhering to the guidelines, but this does not mean they have the right to silence somebody who sees things differently ✌ I'm going to stop the back and forth here as given all the context provided I think it's enough for the reviewer / team to make their decision 🚀 |
Again long msg and you were asking for pushing what!! I said "Consider" but nvm. Great talk and good luck!🙂 |
Any update on this? |
@kaushiktd there is no need to worry, offer can be sent after PR is merged and regression period passes. |
Reviewing |
Yeah, I mean we're still not even in the payment period yet, but I'll send an offer to both just so it's ready right away |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.45-6 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-03-07. 🎊 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:
|
this is not correct i was not involved in the PR |
Thanks @ishpaul777, noted |
@greg-schroeder Friendly bump for payments 🫡 |
Sorry about that, I was OOO yesterday, but I'll process this today! |
Processing now |
All payments complete. @getusha can you complete the checklist so we can close this out? Thanks! |
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: [@getusha] The PR that introduced the bug has been identified. Link to the PR: #21714 Regression Test Proposal
Do we agree 👍 or 👎 |
Filing regression test and closing! |
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.36-1
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: @ishpaul777
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1706234706816449
Action Performed:
Upload a Corrupted pdf in any report
Expected Result:
if pdf preview fails to load "Failed to load PDF file" render
Actual Result:
Nothing renders
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: