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-12-25] [HOLD for payment 2024-12-20] [$250] Expense - Merchant error message is not cleared after completing the field properly #53991

Closed
3 of 8 tasks
IuliiaHerets opened this issue Dec 12, 2024 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 12, 2024

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.0.75-0
Reproducible in staging?: Yes
Reproducible in production?: No
Email or phone of affected tester (no customers): ibellicotest [email protected]
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome
App Component: Money Requests

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Tap on the FAB and select "Create Expense"
  3. Complete with any amount and tap on "Next"
  4. Select any workspace and try to submit the expense without any merchant.
  5. When the error message is displayed, complete the merchant field with valid information.
  6. Try to submit expense again.

Expected Result:

User should be able to submit the expense after completing the merchant field and fixing the error.

Actual Result:

After the user tries to submit an expense to a workspace without merchant, the displayed error message remains despite the field being completed. User is not able to submit the expense after the error is displayed.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6691788_1733979917567.Merchant.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021867142072270891331
  • Upwork Job ID: 1867142072270891331
  • Last Price Increase: 2024-12-12
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

Triggered auto assignment to @joekaufmanexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment and removed Daily KSv2 labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

Triggered auto assignment to @Gonals (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Dec 12, 2024

💬 A slack conversation has been started in #expensify-open-source

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@Gonals Gonals added the External Added to denote the issue can be worked on by a contributor label Dec 12, 2024
@melvin-bot melvin-bot bot changed the title Expense - Merchant error message is not cleared after completing the field properly [$250] Expense - Merchant error message is not cleared after completing the field properly Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

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

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

melvin-bot bot commented Dec 12, 2024

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

@dominictb
Copy link
Contributor

Proposal

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

After the user tries to submit an expense to a workspace without merchant, the displayed error message remains despite the field being completed. User is not able to submit the expense after the error is displayed.

What is the root cause of that problem?

If the merchant is required, an error will be displayed when we click on confirm button without enter a valid merchant.
The problem comes from here the merchant error isn't cleared after the confirmation is lost focus or the transaction is changed

// reset the form error whenever the screen gains or loses focus
clearFormErrors(['iou.error.genericSmartscanFailureMessage', 'iou.receiptScanningFailed']);

Then the merchant error still exist after we change the merchant

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

We need to clear any form error here instead of only special form error

clearFormErrors([formError]); // or we can use setFormError('')


// reset the form error whenever the screen gains or loses focus
clearFormErrors(['iou.error.genericSmartscanFailureMessage', 'iou.receiptScanningFailed']);

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

NA

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.

@dominictb
Copy link
Contributor

@Gonals @joekaufmanexpensify I can raise the quick PR if my proposal is correct

@rojiphil
Copy link
Contributor

I can raise the quick PR if my proposal is correct

@dominictb proposal's RCA and solution makes sense to me. I think we can go ahead with the PR.
@Gonals @joekaufmanexpensify what do you think?

@paultsimura
Copy link
Contributor

Reverting to setFormError('') won't work properly because it will clear other form errors that shouldn't be cleared. This will cause blinking:

Screen.Recording.2024-12-12.at.13.19.26.mov

Anyway, I think we should revert it as a follow-up of our #51517 and think of a better approach with these form errors in some following PR.

@rojiphil
Copy link
Contributor

Anyway, I think we should revert it as a follow-up of our #51517 and think of a better approach with these form errors in some following PR.

@paultsimura Ah! Now I see why a selective clearFormErrors was used. I think the way errors are designed here is that it is triggered whenever we try to submit the expense. And reset the form error whenever the screen gains or lose focus. I think even the invalid rate error needs to align in a similar manner. Can we not fix it this way?

Or we can do a minimum fix using setFormError('') as this is a real blocker due to the fact that it affects the critical flow of submitting expenses.

@paultsimura
Copy link
Contributor

Or we can do a minimum fix using setFormError('') as this is a real blocker due to the fact that it affects the critical flow of submitting expenses.

I agree with this, will raise a PR now, and we'll fix the rate error blinking in my other current PR as it's not critical.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Dec 12, 2024
@joekaufmanexpensify
Copy link
Contributor

Defer to @Gonals on the solution. If he's good, good with me!

@paultsimura
Copy link
Contributor

paultsimura commented Dec 12, 2024

I think I managed to fix both issues at once by just moving the useEffect around and reverting to setFormError('') .
The PR is ready: #54039, but I think it should be reviewed by @Pujan92 as a follow-up from our GH.

@Gonals Gonals added Daily KSv2 Hourly KSv2 and removed Weekly KSv2 Daily KSv2 labels Dec 12, 2024
@Gonals
Copy link
Contributor

Gonals commented Dec 12, 2024

Sounds good to me too. We are going with @paultsimura's solution, then, @rojiphil?

@joekaufmanexpensify
Copy link
Contributor

Sounds good to me to have @Pujan92 review if this is a follow up from another issue

@Pujan92
Copy link
Contributor

Pujan92 commented Dec 12, 2024

Yes, I am on it.

@luacmartins
Copy link
Contributor

Fixed in staging

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Dec 12, 2024
@joekaufmanexpensify joekaufmanexpensify added Weekly KSv2 and removed Hourly KSv2 labels Dec 12, 2024
@joekaufmanexpensify
Copy link
Contributor

PR is merged

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 13, 2024
@melvin-bot melvin-bot bot changed the title [$250] Expense - Merchant error message is not cleared after completing the field properly [HOLD for payment 2024-12-20] [$250] Expense - Merchant error message is not cleared after completing the field properly Dec 13, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 13, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

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

Copy link

melvin-bot bot commented Dec 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.75-6 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-12-20. 🎊

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

  • @rojiphil requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Dec 13, 2024

@rojiphil @joekaufmanexpensify @rojiphil 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]

@joekaufmanexpensify
Copy link
Contributor

PR is out on prod. There isn't any payment to be issued here. This issue was a regression from #51517 , which originally came from #46897. All payment will be handled here.

Going to close this for now, but LMK if anyone has questions on that!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Dec 18, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-12-20] [$250] Expense - Merchant error message is not cleared after completing the field properly [HOLD for payment 2024-12-25] [HOLD for payment 2024-12-20] [$250] Expense - Merchant error message is not cleared after completing the field properly Dec 18, 2024
Copy link

melvin-bot bot commented Dec 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.76-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 2024-12-25. 🎊

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

  • @rojiphil requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Dec 18, 2024

@rojiphil @joekaufmanexpensify @rojiphil 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]

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. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants