-
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 2023-10-27][$500] Manual - Attachment placeholder is shown in preview instead of receipt after adding a receipt #29855
Comments
Triggered auto assignment to @garrettmknight ( |
Job added to Upwork: https://www.upwork.com/jobs/~01c60a9f52756a7c9e |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
Not repro in production bandicam.2023-10-18.15-36-18-490.mp4 |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
|
Triggered auto assignment to @cristipaval ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Image is not shown in confirm page when creating a scan money request What is the root cause of that problem?We get the image and thumbnail from here
but when we have not created the transaction yet there is no source or file name for the transaction and this returns this Line 64 in 39d2a84
and the image is generic image here Line 51 in 39d2a84
What changes do you think we should make in order to solve the problem?We should check if the transaction does not have a source and we should get the image and thumbnail with iou receiptPath and filename
to something like this if (!transaction.source) {
const uris = props.receiptPath && props.receiptFilename
? ReceiptUtils.getThumbnailAndImageURIsFromIOU(props.receiptPath, props.receiptFilename)
: {};
receiptImage = uris.image;
receiptThumbnail = uris.thumbnail;
} else {
const uris = props.receiptPath && props.receiptFilename
? ReceiptUtils.getThumbnailAndImageURIs(transaction)
: {};
receiptImage = uris.image;
and add the function which we were using earlier in ReceiptUtils like this function getThumbnailAndImageURIsFromIOU(path: string, filename: string): ThumbnailAndImageURI {
const isReceiptImage = Str.isImage(filename);
// For local files, we won't have a thumbnail yet
if (isReceiptImage && (path.startsWith('blob:') || path.startsWith('file:'))) {
return {thumbnail: null, image: path};
}
if (isReceiptImage) {
return {thumbnail: `${path}.1024.jpg`, image: path};
}
const {fileExtension} = FileUtils.splitExtensionFromFileName(filename) as FileNameAndExtension;
let image = ReceiptGeneric;
if (fileExtension === CONST.IOU.FILE_TYPES.HTML) {
image = ReceiptHTML;
}
if (fileExtension === CONST.IOU.FILE_TYPES.DOC || fileExtension === CONST.IOU.FILE_TYPES.DOCX) {
image = ReceiptDoc;
}
if (fileExtension === CONST.IOU.FILE_TYPES.SVG) {
image = ReceiptSVG;
}
return {thumbnail: null, image};
} We can move all this common code into a helper function if (isReceiptImage && (path.startsWith('blob:') || path.startsWith('file:'))) {
return {thumbnail: null, image: path};
}
if (isReceiptImage) {
return {thumbnail: `${path}.1024.jpg`, image: path};
}
const {fileExtension} = FileUtils.splitExtensionFromFileName(filename) as FileNameAndExtension;
let image = ReceiptGeneric;
if (fileExtension === CONST.IOU.FILE_TYPES.HTML) {
image = ReceiptHTML;
}
if (fileExtension === CONST.IOU.FILE_TYPES.DOC || fileExtension === CONST.IOU.FILE_TYPES.DOCX) {
image = ReceiptDoc;
}
if (fileExtension === CONST.IOU.FILE_TYPES.SVG) {
image = ReceiptSVG;
}
return {thumbnail: null, image}; and use it both for getting image and thumbnail from transaction or iou What alternative solutions did you explore? (Optional)We can pass
as ReceiptUtils.getThumbnailAndImageURIs(transaction, props.receiptPath, props.receiptFilename) and change params of getThumbnailAndImageURIs in ReceiptUtils to (transaction, receiptPath, receiptFileName) and these lines in getThumbnailAndImageURIs to
|
@c3024 Can you please link which PR has introduced this bug? |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
This comment was marked as outdated.
This comment was marked as outdated.
@fedirjh I think this PR introduced this regression, and @youssef-lr reported it already here |
Yes. Sorry #29474 it is. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.86-5 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 2023-10-25. 🎊 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: As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.87-12 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 2023-10-27. 🎊 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: As a reminder, here are the bonuses/penalties that should be applied for any External 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:
Regression Test Proposal
|
@garrettmknight, @cristipaval, @fedirjh, @c3024 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@garrettmknight , could you please create a GH issue with the regression steps suggested by @fedirjh in the previous comment? |
Is this the same issue? |
Planned here: #31432 |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Issue found when executing PR: #29474
Version Number: v1.3.86-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:
Expected Result:
The receipt will appear in the preview in the confirmation page.
Actual Result:
The preview in the confirmation page shows the attachment placeholder instead of the receipt.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6241508_1697620648971.20231018_101020.mp4
MacOS: Desktop
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: