-
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-08-01] [$250] Scan - No error pop-up and scan expense with corrupted PDF can be submitted via QAB #43645
Comments
Triggered auto assignment to @VictoriaExpensify ( |
We think this issue might be related to the #collect project. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Scan - No error pop-up and scan expense with corrupted PDF can be submitted via QAB What is the root cause of that problem?The pdf error is detected when it is rendered on the confirmation page but in case of QAB, the confirmation page is skipped and we don't get the error alert. This also happens with for protected pdf's. App/src/components/MoneyRequestConfirmationList.tsx Lines 1115 to 1128 in bce61c0
What changes do you think we should make in order to solve the problem?If we want to validate the pdf on scan page then we would need to make few changes.
const [pdfFile, setPdfFile] = useState<null | FileObject>(null);
App/src/pages/iou/request/step/IOURequestStepScan/index.tsx Lines 418 to 434 in 1f7ebfc
const setReceiptAndNavigate = (file: FileObject, isPdfValidated?: boolean) => {
validateReceipt(file).then((isFileValid) => {
if (!isFileValid) {
return;
}
if (Str.isPDF(file.name ?? '') && !isPdfValidated) {
setPdfFile(file);
return;
}
// Store the receipt on the transaction object in Onyx
const source = URL.createObjectURL(file as Blob);
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
IOU.setMoneyRequestReceipt(transactionID, source, file.name || '', action !== CONST.IOU.ACTION.EDIT);
if (action === CONST.IOU.ACTION.EDIT) {
updateScanAndNavigate(file, source);
return;
}
navigateToConfirmationStep(file, source);
});
};
{pdfFile && (
<View style={{position: 'absolute', opacity: 0}}>
<PDFThumbnail
previewSourceURL={pdfFile.uri ?? ''}
onPassword={() => {
setUploadReceiptError(true, 'attachmentPicker.attachmentError', 'attachmentPicker.errorWhileSelectingCorruptedAttachment');
}}
onLoadSuccess={() => {
setPdfFile(null);
setReceiptAndNavigate(pdfFile, true);
}}
onLoadError={() => {
setUploadReceiptError(true, 'attachmentPicker.attachmentError', 'attachmentPicker.errorWhileSelectingCorruptedAttachment');
}}
/>
</View>
)} Note: There are some differences between In this PR, we added the functionality to detect the corrupted pdf files on confirmation page, so if we go with the new solution then we would need to clean up that component as well. What alternative solutions did you explore? (Optional)ResultMonosnap.screencast.2024-06-13.21-00-13.mp4 |
Agree this inconsistency should be fixed |
Job added to Upwork: https://www.upwork.com/jobs/~013830a17b8e9e0b20 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @suneox ( |
@Krishna2323 proposal looks good to me. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
ProposalPlease re-state the problem that we are trying to solve in this issue.There is inconsistency in submitting corrupted PDF via FAB and QAB. What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
then use it in this logic:
and
What alternative solutions did you explore? (Optional) |
@suneox Can you help check my proposal above? TY |
We have another proposal: it also validates files after they are selected without rendering. However, I have some concerns about this approach.
@truph01 Could you please clarify some point above? And thank you for your proposal 🌟 |
@suneox Thanks for your feedback.
|
@truph01 We have to make it consistent at this comment So the scope in this issue also handle password case, due to at confirmation page also validate pdf password. |
@suneox I think that the "inconsistency" mentioned in this #43645 (comment) is about:
|
I believe the scope of this issue should prevent uploading a PDF file with a password. This is because @VictoriaExpensify I'd like to confirm that the scope of this issue involves handling corrupted files and files has password |
@suneox, @grgia, @VictoriaExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@suneox I agree that we should make all pdf error cases consistent as part of this issue. Does that answer your question? |
@truph01 we should cover both cases |
Thank you @suneox, all yours @Krishna2323 ! |
Will raise PR within 2 days. |
@Krishna2323 still working on PR |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.11-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 2024-08-01. 🎊 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
|
Contributor: @Krishna2323 paid $250 via Upwork Contributor+: @suneox paid $250 via Upwork Upwork job here! |
Thanks for your work @suneox and @Krishna2323! 🙌 |
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: v1.4.82-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: https://expensify.testrail.io/index.php?/tests/view/4622999
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
App will show error pop-up and the scan expense is not submitted.
Actual Result:
There is inconsistency in submitting corrupted PDF via FAB and QAB.
App shows error pop-up and the expense is not submitted when submitting via FAB.
App does not show error pop-up and the scan expense is submitted when submitting via QAB.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6511609_1718252208027.20240613_120908.mp4
LARGE PDF FILE corrupted.pdf
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @VictoriaExpensifyThe text was updated successfully, but these errors were encountered: