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 2024-03-13] [$500] Split - "Enter a merchant name" error message appears while scanning is in process #34916
changed the title [-]Split - "Enter a merchant name" error message appears while scanning is in process[/-][+][$500] Split - "Enter a merchant name" error message appears while scanning is in process[/+]on Jan 22, 2024
The shouldDisplayMerchantError was added in #32486. The condition was added in both MoneyRequestConfirmationList and MoneyTemporaryForRefactorRequestConfirmationList (with a different name). I'm pretty sure they just copied it from MoneyTemporaryForRefactorRequestConfirmationList to MoneyRequetConfirmationList without testing the existence of isScanRequest (it's not available on both pages).
The isScanRequest is added in #29473 where it was added for the money request create page only, and not for the split bill details page intentionally.
The reason for the condition is to not show a merchant field if we are going to create a new scan request (just like other field, such as amount), but this condition is not applicable for the split bill details page (which still uses MoneyRequestConfirmationList). On MoneyRequestConfirmationList, we use this condition to decide whether to show an error or not which is not correct.
If we look at MoneyRequestView, we can see the condition to decide whether to show the merchant error or not.
If we later migrate to MoneyTemporaryForRefactorRequestConfirmationList, then we need to pass isEditingSplitBill as false from IOURequestStepConfirmation
Activity
[-]Split - "Enter a merchant name" error message appears while scanning is in process[/-][+][$500] Split - "Enter a merchant name" error message appears while scanning is in process[/+]melvin-bot commentedon Jan 22, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01e28b0f9e8a41bb6e
lanitochka17 commentedon Jan 22, 2024
We think that this bug might be related to #vip-split-p2p-chat-groups
dukenv0307 commentedon Jan 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Error message for missing merchant appears while scanning is in process
What is the root cause of that problem?
We always display the error if merchant is missed without checking the scan is scanning or not
App/src/components/MoneyRequestConfirmationList.js
Line 715 in 616d75f
What changes do you think we should make in order to solve the problem?
We should pass
isScaningfromSplitbillDetailPageintoMoneyRequestConfirmationListand use it to not display any error if the request is scaningApp/src/components/MoneyRequestConfirmationList.js
Line 715 in 616d75f
Or we can wait for
MoneyRequestConfirmationListto be removed and then handle it inMoneyTemporaryForRefactorRequestConfirmationListWhat alternative solutions did you explore? (Optional)
NA
jeremy-croff commentedon Jan 23, 2024
I'm actually unable to reproduce.
Is it specific to some receipts?
bernhardoj commentedon Jan 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The merchant field shows an error on a split bill details page while the receipt is still scanning.
What is the root cause of that problem?
Currently, we show the error if
shouldDisplayMerchantErrororshouldDisplayFieldErroris true.App/src/components/MoneyRequestConfirmationList.js
Line 715 in 9c552ab
shouldDisplayFieldErrorwill be false when the receipt is still scanning.App/src/components/MoneyRequestConfirmationList.js
Lines 276 to 281 in 9c552ab
But
shouldDisplayMerchantErroris always true becauseisScanRequestis always false.App/src/components/MoneyRequestConfirmationList.js
Line 285 in 9c552ab
The
shouldDisplayMerchantErrorwas added in #32486. The condition was added in bothMoneyRequestConfirmationListandMoneyTemporaryForRefactorRequestConfirmationList(with a different name). I'm pretty sure they just copied it fromMoneyTemporaryForRefactorRequestConfirmationListtoMoneyRequetConfirmationListwithout testing the existence ofisScanRequest(it's not available on both pages).The
isScanRequestis added in #29473 where it was added for the money request create page only, and not for the split bill details page intentionally.The reason for the condition is to not show a merchant field if we are going to create a new scan request (just like other field, such as amount), but this condition is not applicable for the split bill details page (which still uses
MoneyRequestConfirmationList). OnMoneyRequestConfirmationList, we use this condition to decide whether to show an error or not which is not correct.If we look at MoneyRequestView, we can see the condition to decide whether to show the merchant error or not.
App/src/components/ReportActionItem/MoneyRequestView.js
Line 225 in 9c552ab
App/src/components/ReportActionItem/MoneyRequestView.js
Line 317 in 9c552ab
And that's the one that we should follow.
What changes do you think we should make in order to solve the problem?
We can update
shouldDisplayMerchantErrorto:Then we can remove the
shouldDisplayFieldErrorhereApp/src/components/MoneyRequestConfirmationList.js
Line 715 in 9c552ab
If we later migrate to
MoneyTemporaryForRefactorRequestConfirmationList, then we need to passisEditingSplitBillas false fromIOURequestStepConfirmationneonbhai commentedon Jan 24, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Split - "Enter a merchant name" error message appears while scanning is in process
What is the root cause of that problem?
This happens as this condition evaluates to
true:App/src/components/MoneyRequestConfirmationList.js
Line 715 in b68abb4
shouldDisplayFieldErrorswould evaluate to betrueif there is any missing field in the request.The problem is we OR the result of
shouldDisplayMerchantError, which does not use the variable correctly.We use
shouldDisplayMerchantErrorto check if the report requires merchant and if an error should be shownWe use this to only show merchant errors, in places where it is a required field.
What changes do you think we should make in order to solve the problem?
The
||condition here should be an&&condition:App/src/components/MoneyRequestConfirmationList.js
Line 715 in b68abb4
We should also add
shouldDisplayMerchantErrorcheck forbrickRoadIndicatorprop condition here:App/src/components/MoneyRequestConfirmationList.js
Line 714 in b68abb4
Result:
Before
Screen.Recording.2024-01-23.at.1.51.04.AM.mov
After
Screen.Recording.2024-01-23.at.1.46.30.AM.mov
Alternatively
For a finer change, since merchant is not a required field for Split Request, while showing error, we should check for
!isSplitBillcondition:neonbhai commentedon Jan 24, 2024
@lanitochka17 hi, looks like we don't have a C+ assigned here 🤔
situchan commentedon Jan 24, 2024
Even BZ member not assigned here 🤔
I can take this as C+
melvin-bot commentedon Jan 30, 2024
6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Feb 1, 2024
8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
86 remaining items
srikarparsi commentedon Mar 26, 2024
Cool, in that case do you want to check off the boxes @situchan or is there something pending before payment?
srikarparsi commentedon Apr 2, 2024
@situchan, do you think you can complete the checklist whenever you get a chance?
melvin-bot commentedon Apr 5, 2024
@anmurali, @srikarparsi, @bernhardoj, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
anmurali commentedon Apr 9, 2024
@situchan - bump on the checklist.
melvin-bot commentedon Apr 12, 2024
@anmurali, @srikarparsi, @bernhardoj, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Apr 16, 2024
@anmurali, @srikarparsi, @bernhardoj, @situchan 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
anmurali commentedon Apr 17, 2024
Since the regression test exists here, and everyone's been paid, I will close this issue