Skip to content
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-01-18] [$500] Expense-No error message when submitting ongoing Scan request and report can be submitted many times #32374

Closed
6 tasks done
lanitochka17 opened this issue Dec 1, 2023 · 43 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 1, 2023

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: 1.4.7-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:
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:

Precondition:

  • User is an employee of a Collect workspace
  1. Log in to ND as the employee
  2. Go to the workspace chat > + > Request money
  3. Create a manual request and a Scan request
  4. Click on the expense preview
  5. Click Submit
    Note that the submit button reappears after submitting the report and there is no error message, only red dot

Expected Result:

If the report cannot be submitted because of the ongoing scanning request, error message will show up

Actual Result:

No error message shows up when submitting report that has ongoing scanning request. Submit button reappears and user can submit it multiple times. Only red dot shows up in LHN

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6297576_1701449098587.20231201_161008.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011fcd78a13230fc56
  • Upwork Job ID: 1730695574080872448
  • Last Price Increase: 2023-12-22
  • Automatic offers:
    • shubham1206agra | Contributor | 28070331
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 1, 2023
@melvin-bot melvin-bot bot changed the title Expense-No error message when submitting ongoing Scan request and report can be submitted many times [$500] Expense-No error message when submitting ongoing Scan request and report can be submitted many times Dec 1, 2023
Copy link

melvin-bot bot commented Dec 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011fcd78a13230fc56

Copy link

melvin-bot bot commented Dec 1, 2023

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 1, 2023
Copy link

melvin-bot bot commented Dec 1, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Dec 1, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

@dukenv0307
Copy link
Contributor

dukenv0307 commented Dec 2, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

No error message shows up when submitting report that has ongoing scanning request. Submit button reappears and user can submit it multiple times. Only red dot shows up in LHN

What is the root cause of that problem?

We're allowing the Submit button when there's scanning requests, so when users click on it, the back-end returns error because there's still scanning requests.

What changes do you think we should make in order to solve the problem?

Either hide or disable the Submit button if there's scanning requests.

If we want to hide it, we can add the check for scanning requests to the shouldShowSubmitButton condition here and here. We can make a common method getShouldShowSubmitButton and reuse in both places.

If we want to disable the button, we can use the scanning requests check in the disabled of submit button.

What alternative solutions did you explore? (Optional)

If we still want to allow users to click on the Submit button when there're scanning requests, we should add report action errors to Onyx data when back-end returns error due to scanning requests, and clear the error on report and report action properly when clicking on x.

This means the back-end can return Onyx error on the submitted ... report action like Please enter the expense details or wait for SmartScan to complete on all attachments before submitting. (this is the message already returned in API response), and we can remove this Onyx merge since it's redundant, the back-end already provides the specific error message that the user can action on rather than a generic error which can confuse the user.

@shubham1206agra
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue

Expense-No error message when submitting ongoing Scan request and report can be submitted many times

What is the root cause of that problem?

This is happening due to the use of incorrect reportActionID in the failure Onyx data in the SubmitReport API call.
The offending lines

App/src/libs/actions/IOU.js

Lines 2682 to 2689 in 1682be4

const failureData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport.reportID}`,
value: {
[expenseReport.reportActionID]: {
errors: ErrorUtils.getMicroSecondOnyxError('iou.error.other'),
},

What changes do you think we should make in order to solve the problem?

We should use optimisticSubmittedReportAction.reportActionID instead of expenseReport.reportActionID.

Result

Screen.Recording.2023-12-02.at.11.45.39.AM.mov

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Dec 4, 2023
Copy link

melvin-bot bot commented Dec 4, 2023

@JmillsExpensify, @rushatgabhane Whoops! This issue is 2 days overdue. Let's get this updated quick!

@JmillsExpensify
Copy link

@rushatgabhane Thoughts on the proposals so far?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 6, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Dec 11, 2023

@JmillsExpensify, @rushatgabhane Huh... This is 4 days overdue. Who can take care of this?

@JmillsExpensify
Copy link

@rushatgabhane thoughts on these proposals?

@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

@JmillsExpensify @rushatgabhane this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Dec 15, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Dec 18, 2023

@JmillsExpensify, @rushatgabhane Eep! 4 days overdue now. Issues have feelings too...

@rushatgabhane
Copy link
Member

reviewing

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2023
@rushatgabhane
Copy link
Member

rushatgabhane commented Dec 18, 2023

We should use optimisticSubmittedReportAction.reportActionID instead of expenseReport.reportActionID

@shubham1206agra i don't agree with this. If success data is for expenseReport.reportID, then why should we set optmistic report Id for failure data?

@shubham1206agra
Copy link
Contributor

We should use optimisticSubmittedReportAction.reportActionID instead of expenseReport.reportActionID

@shubham1206agra i don't agree with this. If success data is for expenseReport.reportID, then why should we set failure data for the optmistic report Id?

@rushatgabhane We set success data for optimisticSubmittedReportAction.reportActionID, which is the message submitter see when submitting the expense report. So failure should be set for the same.

cc @marcochavezf for more context here

Copy link

melvin-bot bot commented Jan 11, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

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.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 11, 2024
@melvin-bot melvin-bot bot changed the title [$500] Expense-No error message when submitting ongoing Scan request and report can be submitted many times [HOLD for payment 2024-01-18] [$500] Expense-No error message when submitting ongoing Scan request and report can be submitted many times Jan 11, 2024
Copy link

melvin-bot bot commented Jan 11, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 11, 2024
Copy link

melvin-bot bot commented Jan 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.24-3 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-01-18. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jan 11, 2024

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:

  • [@rushatgabhane / @shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
  • [@rushatgabhane / @shubham1206agra] 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:
  • [@rushatgabhane / @shubham1206agra] 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:
  • [@rushatgabhane / @shubham1206agra] Determine if we should create a regression test for this bug.
  • [@rushatgabhane / @shubham1206agra] 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.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@rushatgabhane
Copy link
Member

  1. The PR that introduced the bug has been identified. Link to the PR: [NoQA] Feat: Add submit action #28947

  2. 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: [NoQA] Feat: Add submit action #28947 (comment)

  3. 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: No. This bug was caused during first implementation where we sent the wrong reportID in failureData. This bug won't happen again.

  4. Determine if we should create a regression test for this bug. No.

  5. 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 - No

@rushatgabhane
Copy link
Member

@JmillsExpensify please attach a payment summary when you can. Thank you 🙇

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jan 17, 2024
@cead22
Copy link
Contributor

cead22 commented Jan 23, 2024

Not over due, just pending payment

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 23, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

@cead22, @JmillsExpensify, @rushatgabhane, @shubham1206agra Huh... This is 4 days overdue. Who can take care of this?

@shubham1206agra
Copy link
Contributor

@cead22 Can you please resend offer? Original offer expired :(

@melvin-bot melvin-bot bot removed the Overdue label Jan 30, 2024
@JmillsExpensify
Copy link

Payment summary:

@JmillsExpensify
Copy link

$500 payment approved for @rushatgabhane based on summary above.

@JmillsExpensify
Copy link

@shubham1206agra offer sent

@shubham1206agra
Copy link
Contributor

Offer accepted

@JmillsExpensify
Copy link

All contracts paid, so closing this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

6 participants