You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-09-29] [$500] Request money - Scan - Brief disappearance of "Attachment too small" modal text before modal closure #27274
As a result, the attachmentInvalidReasonTitle, and attachmentInvalidReason are set to empty strings first, this makes the text disappear before the modal is completely closed.
What changes do you think we should make in order to solve the problem?
In src/libs/actions/Receipt.ts, we should create a new function closeUploadReceiptModal to update the isAttachmentInvalid to false in order to close the modal
Add onModalHide prop to ConfirmModal, and pass the Receipt.clearUploadReceiptError function so that we can successfully clear all the error messages once the modal is completely closed
What alternative solutions did you explore? (Optional)
In the clearUploadReceiptError function, instead of setting both attachmentInvalidReasonTitle and attachmentInvalidReason to empty strings, we just need to update
the isAttachmentInvalid to false in Onyx.
changed the title [-]Request money - Scan - Brief disappearance of "Attachment too small" modal text before modal closure[/-][+][$500] Request money - Scan - Brief disappearance of "Attachment too small" modal text before modal closure[/+]on Sep 12, 2023
Please re-state the problem that we are trying to solve in this issue.
Brief disappearance of "Attachment too small" modal text before modal closure
What is the root cause of that problem?
The issue is coming from the ReceiptSelector component. The prop receiptModal coming from onyx is being reset to it's initial state before the modal gets closed.
What changes do you think we should make in order to solve the problem?
Introduce a state variable to handle the modal visibility
const[showModal,setShowModal]=useState(false);
Add a useffect to update the new state variable when the receipt is invalidated
Add a new function that will be called when we close the modal. The function will set the showModal state variable to false, and once that's done it'll then call the receipt action clearUploadReceiptError.
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:
[@jjcoffee] The PR that introduced the bug has been identified. Link to the PR:
[@jjcoffee] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@jjcoffee] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@jjcoffee] Determine if we should create a regression test for this bug.
[@jjcoffee] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The PR that introduced the bug has been identified. Link to the PR: N/A - behaviour has been there since the original PR that added the feature.
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/A
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
Determine if we should create a regression test for this bug. No - low impact
If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. N/A
Activity
dukenv0307 commentedon Sep 12, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Brief disappearance of "Attachment too small" modal text before modal closure
What is the root cause of that problem?
App/src/pages/iou/ReceiptSelector/index.js
Lines 143 to 151 in 662af46
App/src/pages/iou/ReceiptSelector/index.js
Lines 65 to 67 in 662af46
App/src/libs/actions/Receipt.ts
Line 18 in 662af46
App/src/components/Modal/BaseModal.js
Line 189 in a365583
As a result, the attachmentInvalidReasonTitle, and attachmentInvalidReason are set to empty strings first, this makes the text disappear before the modal is completely closed.
What changes do you think we should make in order to solve the problem?
App/src/pages/iou/ReceiptSelector/index.js
Line 143 in 662af46
What alternative solutions did you explore? (Optional)
the isAttachmentInvalid to false in Onyx.
App/src/libs/actions/Receipt.ts
Line 18 in 662af46
Result
Screen.Recording.2023-09-12.at.14.43.19.mov
melvin-bot commentedon Sep 12, 2023
Triggered auto assignment to @kadiealexander (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.[-]Request money - Scan - Brief disappearance of "Attachment too small" modal text before modal closure[/-][+][$500] Request money - Scan - Brief disappearance of "Attachment too small" modal text before modal closure[/+]melvin-bot commentedon Sep 12, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01fc29b362e680f18d
melvin-bot commentedon Sep 12, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Sep 12, 2023
Triggered auto assignment to @NicMendonca (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.melvin-bot commentedon Sep 12, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)oogushikun commentedon Sep 12, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Brief disappearance of "Attachment too small" modal text before modal closure
What is the root cause of that problem?
The issue is coming from the ReceiptSelector component. The prop receiptModal coming from onyx is being reset to it's initial state before the modal gets closed.
What changes do you think we should make in order to solve the problem?
Result
receiptselector-1.mov
33 remaining items
melvin-bot commentedon Sep 22, 2023
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:
kadiealexander commentedon Sep 29, 2023
Payouts due:
Eligible for 50% #urgency bonus? Yes
Upwork job is here.
kadiealexander commentedon Sep 29, 2023
@jjcoffee please complete the BugZero Checklist.
@ayazhussain79 please accept the Upwork contract I sent across.
ayazhussain79 commentedon Sep 29, 2023
@kadiealexander offer accepted, Thank you
jjcoffee commentedon Sep 29, 2023
jjcoffee commentedon Sep 29, 2023
@kadiealexander Checklist complete!
melvin-bot commentedon Oct 2, 2023
@johnmlee101, @jjcoffee, @kadiealexander, @dukenv0307 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
kadiealexander commentedon Oct 3, 2023
Everyone is paid!