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 #31411] [$500] Scan - None not displayed in merchant while offline & after adding amount & going online #32552
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsWeeklyKSv2
Version Number: 1.4.8-1 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:
Open the app and log in
Disable internet connection
Tap FAB > Request Money > Scan
Select a receipt and a user
Complete the request
Navigate to the transaction chat
Enter the amount
Enable internet connection
Expected Result:
"None" is displayed in the Merchant field while offline and after adding amount and going online, the red dot is shown
Actual Result:
"Request" is displayed in the Merchant field offline and after adding the amount and returning online, the red dot is not shown unlike in the online flow.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Scan - None not displayed in merchant while offline & after adding amount & going online[/-][+][$500] Scan - None not displayed in merchant while offline & after adding amount & going online[/+]on Dec 6, 2023
Please re-state the problem that we are trying to solve in this issue.
Merchant is not set to (none) when creating the scan request offline. Also, the error is not shown when coming back online after modifying the request.
What is the root cause of that problem?
We do not set the (none) merchant value optimistically when placing the scan money request. The RBR is displayed if the value is set to (none), which is set on the API response of RequestMoney API call (which doesn't happen when online).
What changes do you think we should make in order to solve the problem?
When creating an optimistic transaction, we should check if it's a scan transaction, and if so – set "none" instead of the default "Request" in the merchant (using constants and polishing the code a bit, but the idea is understandable):
Note: There is another issue happening – the optimistic transaction report gets replaced when coming back online, which leads to an error if the request created online optimistically is opened when coming back online. It will be fixed in #31411 – asked and got a confirmation here. Therefore, we may want to hold this issue until that one is done.
What alternative solutions did you explore? (Optional)
It's to fix this issue #28380 where BE response will return Request if the merchant is empty, so we align the optimistic data with the BE response. But now, the BE response return (none) if the merchant sent to the API is empty.
When we update the amount (or other field), it will stop the smart scan and will show an error if there is an empty required field, such as the merchant field.
However, as we optimistically set the merchant to Request, the error won't show.
What changes do you think we should make in order to solve the problem?
The merchant will detect (none) as an empty merchant, so my suggestion is to make sure whether it's expected that the BE now returns (none) for an empty merchant or it should be Request like in #29118.
If it's expected that it now returns (none), we can revert #29118 and adjust the code a little bit by replacing the empty string with (none).
"None" is displayed in the Merchant field while offline, and after adding amount and going online, the red dot is shown
@trjExpensify For the expected result, could you please verify it ? why the red dot should be shown when we change the amount in offline mode while the request is scanning?
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsWeeklyKSv2
Activity
melvin-bot commentedon Dec 6, 2023
Triggered auto assignment to @trjExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.[-]Scan - None not displayed in merchant while offline & after adding amount & going online[/-][+][$500] Scan - None not displayed in merchant while offline & after adding amount & going online[/+]melvin-bot commentedon Dec 6, 2023
Job added to Upwork: https://www.upwork.com/jobs/~015c62fdfd300d1084
melvin-bot commentedon Dec 6, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Dec 6, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (
External)paultsimura commentedon Dec 6, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Merchant is not set to
(none)when creating the scan request offline. Also, the error is not shown when coming back online after modifying the request.What is the root cause of that problem?
We do not set the
(none)merchant value optimistically when placing the scan money request. The RBR is displayed if the value is set to(none), which is set on the API response ofRequestMoneyAPI call (which doesn't happen when online).What changes do you think we should make in order to solve the problem?
When creating an optimistic transaction, we should check if it's a scan transaction, and if so – set "none" instead of the default "Request" in the merchant (using constants and polishing the code a bit, but the idea is understandable):
App/src/libs/TransactionUtils.ts
Line 69 in 030cfe1
Note: There is another issue happening – the optimistic transaction report gets replaced when coming back online, which leads to an error if the request created online optimistically is opened when coming back online. It will be fixed in #31411 – asked and got a confirmation here. Therefore, we may want to hold this issue until that one is done.
What alternative solutions did you explore? (Optional)
bernhardoj commentedon Dec 6, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/libs/TransactionUtils.ts
Line 69 in 276b007
It's to fix this issue #28380 where BE response will return Request if the merchant is empty, so we align the optimistic data with the BE response. But now, the BE response return (none) if the merchant sent to the API is empty.
App/src/libs/TransactionUtils.ts
Lines 135 to 138 in 276b007
App/src/components/ReportActionItem/MoneyRequestView.js
Lines 161 to 165 in 276b007
App/src/libs/TransactionUtils.ts
Lines 372 to 374 in 276b007
However, as we optimistically set the merchant to Request, the error won't show.
What changes do you think we should make in order to solve the problem?
The merchant will detect (none) as an empty merchant, so my suggestion is to make sure whether it's expected that the BE now returns (none) for an empty merchant or it should be Request like in #29118.
If it's expected that it now returns (none), we can revert #29118 and adjust the code a little bit by replacing the empty string with (none).
trjExpensify commentedon Dec 6, 2023
@mountiny given the changes you're making, is this issue going to be obsolete?
mountiny commentedon Dec 6, 2023
I am not 100% sure, this Pr is handling the manual requests only not the scan case #32222
I think the solutions from @paultsimura and @bernhardoj are valid for this problem
23 remaining items
trjExpensify commentedon Jan 31, 2024
Still held, PR should be coming soon!
trjExpensify commentedon Feb 9, 2024
No change!
trjExpensify commentedon Feb 19, 2024
@fedirjh I think the PR we're held on is this, right?
fedirjh commentedon Feb 19, 2024
@trjExpensify Yes that's right.
trjExpensify commentedon Feb 19, 2024
Sounds good!
fedirjh commentedon Feb 28, 2024
@trjExpensify The PR was deployed to staging.
@trjExpensify For the expected result, could you please verify it ? why the red dot should be shown when we change the amount in offline mode while the request is scanning?
trjExpensify commentedon Mar 1, 2024
I don't think this is a valid bug anymore.
Going to close it out!