App: [SMARTSCAN] [$500] MEDIUM: Update the workspace chat report preview component when a receipt scan completes
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Prerequisite: Use the example receipt provided below, because it will likely hit an image parser and complete super fast to test this.
- Create a workspace on staging.new.expensify.com
- Invite a member to it
- As the member, sign-in and navigate to your workspace chat on the workspace
- Upload a receipt
- Observe the “Receipt scan in progress…” report preview component
- Give it 15-30s or so to finish scanning
- Navigate away from the workspace chat (i.e tap
<to the LHN or click the report preview component) - Navigate back to the workspace chat
Expected Result:
The report preview component should update with the receipt data automatically without needing to navigate away and back to the chat
Actual Result:
The report preview component does not update
Workaround:
Yes, as described above to navigate away and back.
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android / native
- Android / Chrome
- iOS / native
- iOS / Safari
- MacOS / Chrome / Safari
- MacOS / Desktop
Version Number: v1.3.64-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
Notes/Photos/Videos:
mWeb safari reproduction: https://github.com/Expensify/App/assets/16232057/019912f4-8c89-415f-92c6-8f1f363a033e
iOS native app reproduction: https://github.com/Expensify/App/assets/16232057/2fa42280-be97-49d9-a62a-5de4699bf94c
Mac Chrome reproduction: https://github.com/Expensify/App/assets/16232057/13172aa7-0abe-435e-aa24-8e25e9225077
Example receipt to use:
Expensify/Expensify Issue URL: Issue reported by: @trjExpensify Slack conversation: Internal
CC: @Gonals @MariaHCD @JmillsExpensify @dylanexpensify
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01eae90794b2b26fd4
- Upwork Job ID: 1699178450385817600
- Last Price Increase: 2023-10-02
Issue Owner
Current Issue Owner: @MariaHCDAbout this issue
- Original URL
- State: closed
- Created 10 months ago
- Comments: 100 (68 by maintainers)
I think I managed to find all root cause and solution.
BUG1: (frontend) report preview is not re-rendered when transaction pusher event is received so keep scanning
After fixing BUG1, “keep scanning” issue is gone. But amount shows 0 instead of correct value fetched from receipt. This is because of BUG2 and BUG3 below:
BUG2: (backend) report action pusher event is not received so
message[0].textis still old value. i.e.xxx owes $0.00which expectsxxx owes $20.00https://github.com/Expensify/App/blob/3bbb2142cd3744cc5942ef6494d096c7a2b42ffe/src/components/ReportActionItem/ReportPreview.js#L160-L169
BUG3: (backend) iouReport pusher event is not received so
totalis still old value as 0.Fixing BUG2 still doesn’t fix the issue completely. It’s just fallback when
iouReportdoesn’t exist oriouReport.total = 0according to this line: https://github.com/Expensify/App/blob/3bbb2142cd3744cc5942ef6494d096c7a2b42ffe/src/components/ReportActionItem/ReportPreview.js#L150-L152Either fixing BUG2 or BUG3 will fix wrong amount issue but BUG3 is more priority than BUG2 because
iouReporthas important data of whether to show or hide settlement button:https://github.com/Expensify/App/blob/3bbb2142cd3744cc5942ef6494d096c7a2b42ffe/src/components/ReportActionItem/ReportPreview.js#L188-L190
Especially this condition:
reimbursableSpend !== 0cc: @MariaHCD
Thanks, @MariaHCD. Looks like Ioni has responded with a coupla’ Qs!
@s-alves10 fixing bug 2 or bug 3 will fix bug 1 because ReportPreview is re-rendered. If transaction pusher event is received separately, this should be issue but I don’t think backend will do that. All events will come together when scan complete. So all good.
Ah, I think we can add
ReviewingInternaland removeHelp Wantedright, Maria?