-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-04-14] [$250] Scan receipt-Choose an action bar is shown twice #59040
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
Comments
Triggered auto assignment to @NicMendonca ( |
🚨 Edited by proposal-police: This proposal was edited at 2025-03-25 08:22:44 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Scan receipt-Choose an action bar is shown twice What is the root cause of that problem?The problem occurs because tapping the "Choose an Action" button twice quickly calls openPicker twice. This leads to the action bar show twice, and after select a file that show again App/src/components/AttachmentPicker/index.tsx Lines 104 to 110 in 8c827d7
What changes do you think we should make in order to solve the problem?We can Introduce a flag
const isPickingRef = useRef(false);
{children({
openPicker: ({onPicked: newOnPicked, onCanceled: newOnCanceled = () => {}}) => {
if (isPickingRef.current) {
return; // Prevent multiple rapid calls
}
isPickingRef.current = true;
onPicked.current = newOnPicked;
fileInput.current?.click();
onCanceled.current = newOnCanceled;
},
})}
onChange={(e) => {
isPickingRef.current = false; // Reset flag after picking
...
}}
.....
fileInput.current.addEventListener(
'cancel',
() => {
isPickingRef.current = false; // Reset flag on cancel
....
);
}} What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?We can write unit test to trigger openPicker, then verify that not call multiple times What alternative solutions did you explore? (Optional)We can use |
ProposalPlease re-state the problem that we are trying to solve in this issue.The "Choose an action" bar is shown again after selecting a file and the selected file is lost. What is the root cause of that problem?We don't have logics to limit number of presses on choose file button App/src/pages/iou/request/step/IOURequestStepScan/index.tsx Lines 774 to 778 in dc8eb79
What changes do you think we should make in order to solve the problem?Add a ref to track if button is pressed const isButtonPressedRef = useRef(false) And modify the App/src/pages/iou/request/step/IOURequestStepScan/index.tsx Lines 774 to 778 in dc8eb79
onPress={() => {
if (isPressedRef.current) {
return;
}
isPressedRef.current = true;
openPicker({
onPicked: (data) => {
isPressedRef.current = false
setReceiptAndNavigate(data.at(0) ?? {})}
},
onCanceled: () => {
isPressedRef.current = false;
},
});
}} What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?None What alternative solutions did you explore? (Optional)If we want to fix this issue globally, we can apply the solution directly inside AttachmentPicker. Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Job added to Upwork: https://www.upwork.com/jobs/~021904624742452177775 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 ( |
@linhvovan29546's proposal looks good to me as it is more generic because it is suggesting the fix in the 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @rafecolton, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @linhvovan29546 🎉 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.1.23-7 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 2025-04-14. 🎊 For reference, here are some details about the assignees on this issue:
|
@Pujan92 @NicMendonca @Pujan92 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] |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test Proposal Template
Regression Test ProposalPrecondition:Test:Do we agree 👍 or 👎 |
@linhvovan29546 you've been paid! @Pujan92 friendly bump on the checklist! |
@Pujan92 Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@Pujan92 Still overdue 6 days?! Let's take care of this! |
I think we don't need a checklist here as it is an edge case. Regression Test Proposal
|
Payment summaryC+: @Pujan92 - $250 paid via NewDot |
$250 approved for @Pujan92 |
Uh oh!
There was an error while loading. Please reload this page.
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.1.18-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #54551
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Samsung S23FE/ Android 14
App Component: Money Requests
Action Performed:
Precondition: Camera permission granted on the web browser.
Steps:
Expected Result:
The "Choose an action" bar is shown only once after tapping the Choose an action button, and next after selecting a file, the Choose recipient page is displayed.
Actual Result:
The "Choose an action" bar is shown again after selecting a file and the selected file is lost.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6781070_1742865013479.Choose_an_action_bar.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Pujan92The text was updated successfully, but these errors were encountered: