-
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-10-24] [$250] Search - Attachment from qa.guide loads infinitely when opened in Search #50006
Comments
Triggered auto assignment to @garrettmknight ( |
@garrettmknight 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 |
We think that this bug might be related to #wave-control |
Job added to Upwork: https://www.upwork.com/jobs/~021841561644716083523 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @suneox ( |
Edited by proposal-police: This proposal was edited at 2024-10-03 13:17:41 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Attachment from qa.guide loads infinitely when opened in Search What is the root cause of that problem?The reason for this ticket is that we are attempting to authenticate an attachment that is not an Expensify source, which prevents the attachment from loading and results in an infinite loading state. In the case of this ticket, this GIF will use What changes do you think we should make in order to solve the problem?I suggest two options to fix this issue: Option 1: We should update isAuthTokenRequired in cases where the source is not Expensify when opening the attachment modal from Search// .src/components/SelectionList/ChatListItem.tsx#L43
- const attachmentContextValue = {type: CONST.ATTACHMENT_TYPE.SEARCH};
+ const attachmentContextValue = {reportID: item.reportID, type: CONST.ATTACHMENT_TYPE.SEARCH}; // .src/components/AttachmentModal.tsx#L543
+ const [isImageAuthTokenRequired, setImageAuthTokenRequired] = useState(isAuthTokenRequired);
- {!shouldShowNotFoundPage &&
- (!isEmptyObject(report) && !isReceiptAttachment ? (
+ {!shouldShowNotFoundPage &&
+ (!isEmptyObject(report) && !isReceiptAttachment && type !== CONST.ATTACHMENT_TYPE.SEARCH ? (
<AttachmentCarousel
.... // .src/components/Attachments/AttachmentView/index.tsx#L238
+ const compareImage = useCallback((attachment: Attachment) => attachment.source === source, [source]);
+ useEffect(() => {
+ if (type !== CONST.ATTACHMENT_TYPE.SEARCH) return;
+ const prReportAction = report?.parentReportActionID && parentReportActions ? parentReportActions[report?.parentReportActionID] : undefined;
+ const newAttachments: Attachment[] = extractAttachments(CONST.ATTACHMENT_TYPE.REPORT, {parentReportAction: prReportAction, reportActions: reportActions ?? undefined});
+ const newIndex = newAttachments.findIndex(compareImage);
+ const attachment = newAttachments.at(newIndex);
+ if (attachment?.isAuthTokenRequired !== undefined) {
+ setImageAuthTokenRequired(attachment?.isAuthTokenRequired);
+ }
+ }, [compareImage, parentReportActions, report?.parentReportActionID, reportActions, type]);
// .src/components/AttachmentModal.tsx#L291
<AttachmentViewImage
....
+ isAuthTokenRequired={type === CONST.ATTACHMENT_TYPE.SEARCH ? isImageAuthTokenRequired : isAuthTokenRequired} Option 2: We use AttachmentCarousel when opening the attachment modal from Search to fix this issue because AttachmentCarousel checks isAuthTokenRequired for attachments inside. To use AttachmentCarousel, we need to update the code as shown below:// .src/components/SelectionList/ChatListItem.tsx#L43
- const attachmentContextValue = {type: CONST.ATTACHMENT_TYPE.SEARCH};
+ const attachmentContextValue = {reportID: item.reportID, type: CONST.ATTACHMENT_TYPE.SEARCH}; POC
Screen.Recording.2024-10-06.at.23.08.21.mov |
We’re still awaiting a proposal on this issue. The RCA and solution provided by @huult proposal are not correct. |
@suneox @lanitochka17 I think the "Action performed:" steps and the provided video are not clear to users who are not familiar with Expensify. How to see |
@shahinyan11 At step 3 you have to copy content |
Edited by proposal-police: This proposal was edited at 2024-10-03 18:12:20 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Search - Attachment from qa.guide loads infinitely when opened in Search What is the root cause of that problem?Here Is described in which cases the image need to have an What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional) |
@suneox Thanks for your help. |
Proposal Updated
@suneox, could you please check again? Thank you. |
Thanks for all the proposals. I don’t think this issue is related to CORS blocking, since the images from both the chat and the search load the same resource url, just only the headers being different. Screen.Recording.2024-10-04.at.18.09.12.mp4@shahinyan11 Your solution doesn't work on my side
@huult Could you please explain why updating the reportID parameter in the URL allows us to get a cached image, even though the image source (attachment?source) from URL does not change? |
@suneox Do you mean that my solution doesn't work at all or it's a workaround? |
@shahinyan11 Your solution doesn’t work as expected, the image still loads indefinitely Screen.Recording.2024-10-04.at.22.21.04.mp4 |
ProposalUpdated. I have updated the RCA and solution. Could you check please and leave feedback |
Proposal update
Hi @suneox , could you please check it again? thanks |
Thanks for all the updates. I’ll reevaluate them within today. |
Although both solutions can resolve the issue but @shahinyan11’s solution is simpler. Instead of always setting 🎀 👀 🎀 C+ reviewed |
📣 @suneox 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @shahinyan11 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.49-2 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-10-24. 🎊 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
|
All paid out! |
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: 9.0.42-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: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team
Action Performed:
in #admins)
Expected Result:
The attachment will load without issue
Actual Result:
The attachment loads infinitely
This issue only happens to this specific attachment
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6621041_1727782649186.20241001_192422.1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @garrettmknightThe text was updated successfully, but these errors were encountered: