-
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-01-04] [HOLD for payment 2024-01-03] [$500] Chat - PDF is not displayed in chat after uploading #33626
Comments
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Triggered auto assignment to @Beamanator ( |
Issue is not reproduced on production RPReplay_Final1703624381.MP4 |
Job added to Upwork: https://www.upwork.com/jobs/~01a3278ab046cf0de8 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat ( |
I think this might be related to the expo image pr #30905 and seems like a true blocker as PDF files cannot be used/ sent in native devices cc @WojtekBoman |
The PDF previews are missing even after coming back to the chat so definitely a blocker imho |
holy monkeys that's a big diff 😅 Would be great if @WojtekBoman could help investigate this 🙏 I'll try to test locally soon, assuming my sims start up nicely |
ProposalPlease re-state the problem that we are trying to solve in this issue.PDF preview is not displayed in chat What is the root cause of that problem?This is We check App/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js Lines 48 to 49 in 4cfb8a2
As "0" is not falsy, it doesn't meet above condition and App/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js Lines 83 to 89 in 4cfb8a2
In ThumbnailImage, there's default value of 200 but as it's already set to "0", the default value is ignored App/src/components/ThumbnailImage.tsx Line 73 in 4cfb8a2
What changes do you think we should make in order to solve the problem?App/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js Lines 48 to 49 in 4cfb8a2
We can update this condition so check "0" as well: - const imageWidth = htmlAttribs['data-expensify-width'] ? parseInt(htmlAttribs['data-expensify-width'], 10) : undefined;
- const imageHeight = htmlAttribs['data-expensify-height'] ? parseInt(htmlAttribs['data-expensify-height'], 10) : undefined;
+ const imageWidth = +htmlAttribs['data-expensify-width'] ? parseInt(htmlAttribs['data-expensify-width'], 10) : undefined;
+ const imageHeight = +htmlAttribs['data-expensify-height'] ? parseInt(htmlAttribs['data-expensify-height'], 10) : undefined; (+ operator converts string to number so |
Hmm @mkhutornyi I like your idea, but i think we need to know why this is now necessary - a.k.a. what's different in prod now & how did things change? |
I am afraid the SWM developers will be ooo mostly so we should not wait for them. @mkhutornyi could you pinpoint whats the rootcause of this being different in staging than in production? thanks! |
Before, we used FastImage and onLoad callback was called even when width/height layout is not set.
This is supposed to call App/src/components/ThumbnailImage.tsx Lines 86 to 94 in 6365aeb
|
My solution still has issue of showing default size (200, 200) briefly before getting correct size. |
It seems like you are facing an issue where the default size (200, 200) is briefly shown before getting the correct size when using the updateImageSize function. I think the solution is to set an initial state for thumbnailWidth and tumbnailHeight before calculating and updating them. In this way, the Here is my answer.
In this code, by setting the initial values before the asynchronous calculation, you ensure that the default size is set before the component renders. The await keyword is used to wait for the asynchronous calculation to complete before updating the state with the correct size. (I have assume that calculate ThumbnailmageSize returns a Promise or is an asynchronous function. If it is a synchronous function, you can remove the async keyword and the await statement.) if my answer makes any problem or make sense to you plz ping me. |
📣 @kevinpetersson! 📣
|
It seems like you are facing an issue where the default size (200, 200) is briefly shown before getting the correct size when using the updateImageSize function. I think the solution is to set an initial state for thumbnailWidth and tumbnailHeight before calculating and updating them. In this way, the Here is my answer.
In this code, by setting the initial values before the asynchronous calculation, you ensure that the default size is set before the component renders. The await keyword is used to wait for the asynchronous calculation to complete before updating the state with the correct size. (I have assume that calculate ThumbnailmageSize returns a Promise or is an asynchronous function. If it is a synchronous function, you can remove the async keyword and the await statement.) if my answer makes any problem or make sense to you plz ping me. |
With RNFastImage we had this issue only on Android which was fixed with a patch. With Expo Image it is on iOS as well. I think properly addressing the App/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.js Lines 48 to 49 in 6365aeb
like @mkhutornyi suggested is a good approach. |
📣 @mkhutornyi 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@mkhutornyi can you raise the pr? I think that showing briefly wrong size is fine for now to unblock deploy |
Bug0 Triage Checklist (Main S/O)
|
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.17-8 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-01-03. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
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:
|
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:
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.18-8 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-01-04. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
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:
|
Checklist is posted #33626 (comment) |
@peterdbarkerUK, @parasharrajat, @mountiny, @mkhutornyi Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@peterdbarkerUK, @parasharrajat, @mountiny, @mkhutornyi Still overdue 6 days?! Let's take care of this! |
Payment summary:
|
@peterdbarkerUK Feel free to close this. I will request it later. |
Payment requested as per #33626 (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.17-1
Reproducible in staging?: y
Reproducible in production?: n
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:
Pre-requisite: the user must be logged in.
Expected Result:
PDF preview should be displayed in chat after the uploading.
Actual Result:
PDF preview is not displayed in chat after the uploading.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6326434_1703625657812.Chox1648_1_.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @parasharrajatThe text was updated successfully, but these errors were encountered: