-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-11-21] [$250] mWweb - Chat - From search page, tapping on image doesn't show image #51161
Comments
Triggered auto assignment to @stephanieelliott ( |
@stephanieelliott 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 |
ProposalPlease re-state the problem that we are trying to solve in this issue.From search page, tapping on image doesn't show image. What is the root cause of that problem?We don't pass
Then we navigate to the attachment page with App/src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx Lines 80 to 93 in 44f5c5c
What changes do you think we should make in order to solve the problem?Pass the
What alternative solutions did you explore? (Optional) |
Job added to Upwork: https://www.upwork.com/jobs/~021848845902924647302 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Edited by proposal-police: This proposal was edited at 2024-10-23 17:19:12 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.From search page, tapping on image doesn't show image What is the root cause of that problem?This is a case of HTML rendering. The root cause of this issue is that the image does not have an extension in its source URL, and no file name is provided. As a result, the isFileImage condition check fails, causing the image not to display and the default attachment image to be shown instead. We open this image from 1 The check for whether this source is an image file failed because it doesn't have an extension like PNG or JPG, so
the condition check at if (isFileImage) { fails, resulting in the default attachment being loaded, as described in this issue. App/src/components/Attachments/AttachmentView/index.tsx Lines 219 to 223 in 48d6f84
The reason we don't have a
We don't have the
We can load this image from the
What changes do you think we should make in order to solve the problem?For those cases where the attachment doesn't have a source extension, we must provide a To resolve this issue,
//.src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx#L60
+ let fileName = htmlAttribs[CONST.ATTACHMENT_ORIGINAL_FILENAME_ATTRIBUTE] || FileUtils.getFileName(`${isAttachmentOrReceipt ? attachmentSourceAttribute : htmlAttribs.src}`);
+ const fileInfo = FileUtils.splitExtensionFromFileName(fileName);
+ if (!fileInfo.fileExtension) {
+ fileName = `${fileInfo.fileName || 'image'}.jpg`;
+ }
//.src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx#L101
- const route = ROUTES.ATTACHMENTS?.getRoute(reportID ?? '-1', type, source, accountID, isAttachmentOrReceipt);
+ const route = ROUTES.ATTACHMENTS?.getRoute(reportID ?? '-1', type, source, accountID, isAttachmentOrReceipt, fileName);
//.src/ROUTES.ts#L312
- getRoute: (reportID: string, type: ValueOf<typeof CONST.ATTACHMENT_TYPE>, url: string, accountID?: number, isAuthTokenRequired?: boolean) => {
+ getRoute: (reportID: string, type: ValueOf<typeof CONST.ATTACHMENT_TYPE>, url: string, accountID?: number, isAuthTokenRequired?: boolean, fileName?: string) => {
...
- return `attachment?source=${encodeURIComponent(url)}&type=${type}${reportParam}${accountParam}${authTokenParam}` as const;
+ const fileNameParam = fileName ? `&fileName=${fileName}` : '';
+ return `attachment?source=${encodeURIComponent(url)}&type=${type}${reportParam}${accountParam}${authTokenParam}${fileNameParam}` as const;
} ,
//.src/pages/home/report/ReportAttachments.tsx#L37
+ const fileName = route.params.fileName;
<AttachmentModal
...
+ originalFileName={fileName ?? ''}
/> Here is test branch Screen.Recording.2024-10-24.at.00.17.14.mov |
Thanks for the proposal @mkzie2 Could you please add more depth to your RCA? It seems like you're mainly validating your solution in the RCA section. If we pass
|
@sobitneupane , They can't update the |
Proposal Updated
@sobitneupane can you review my proposal? |
@sobitneupane, @stephanieelliott Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Hey @sobitneupane any thoughts considering the context provided here? |
@sobitneupane, @stephanieelliott Eep! 4 days overdue now. Issues have feelings too... |
Triggered auto assignment to @puneetlath, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @huult 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Thank you all. I will create the PR within 24 hours |
Hey @sobitneupane the PR is waiting for your review, can you take a look? |
PR has been merged to main |
@puneetlath / @sobitneupane looks like your fix might be causing a crash here: #52475 |
@garrettmknight I think this bug is not related to this ticket because it occurs due to inputting a link with long text in the composer. I tried to reproduce it, and it's working well. |
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.61-3 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-11-21. 🎊 For reference, here are some details about the assignees on this issue:
|
@sobitneupane @puneetlath / @stephanieelliott @sobitneupane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
Hi @puneetlath @stephanieelliott , Sorry, I still have not received the payment. Can you help me check? Maybe we have an issue with Upwork? |
Summarizing payment on this issue:
Upwork job is here: https://www.upwork.com/jobs/~021848845902924647302 |
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: V9. 0.51-1
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
From search page, tapping on image must show image.
Actual Result:
From search page, tapping on image doesn't show image.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6640158_1729418863865.Screenrecorder-2024-10-20-15-28-41-958_compress_1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @stephanieelliott / @stephanieelliottThe text was updated successfully, but these errors were encountered: