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
[$500] mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second #30431
Tap on a 1:1 report of user A and User B in 2 devices
Tap plus icon to select Send money as User A
Enter an amount
Tap next
Tap Pay elsewhere
Note in user B 1:1 page, TBD displayed for a second and them amount with green tick mark displayed
Expected Result:
When user A sends money to user B and paid elsewhere, in User B conversation page, TBD must not be shown before amount paid with green tick mark displayed.
Actual Result:
When user A sends money to user B and paid elsewhere, in User B conversation page, TBD appears for an second before amount paid with green tick mark displayed.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second[/-][+][$500] mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second[/+]on Oct 26, 2023
However, the report preview will still flicker, just with different data: it'll show "owes: {amount}" which will be changed to "{user} paid: {amount}" on the following re-render.
I believe we are facing the Onyx updates order issue here once again #28737 (comment)
The Pusher sends data in the correct order: first, the IOU Report and the Transaction, and only then – the REPORTPREVIEW report action. But the ReportView component is rendered with the reversed data order: first, the reportAction is created, and only then – the IOU report is fetched.
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second
What is the root cause of that problem?
This is happening in all platforms but only can be appreciated in the slower ones. What occurs here is we are calling getDisplayAmount on every render and not when we need it, that's why we can see the TBD for a second before another render updates the text. Additionally, huge rerender causes slowness in the chat performance.
What changes do you think we should make in order to solve the problem?
@paultsimura does correct order fix for onyx will automatically fix current issue?
It should, because the iouReport will be present at the moment the reportAction is added, and the flickering currently happens because the iouReport is missing.
However, that Onyx issue has been open for a while, and I'm curious if we'll have any progress on it anytime soon...
changed the title [-][HOLD App #30219] [$500] mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second[/-][+][$500] mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second[/+]on Jan 17, 2024
Activity
[-]mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second[/-][+][$500] mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second[/+]melvin-bot commentedon Oct 26, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01b75010b5fae71d08
melvin-bot commentedon Oct 26, 2023
Triggered auto assignment to @mallenexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 26, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 26, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @narefyev91 (
External)paultsimura commentedon Oct 26, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user receives money, the report preview displays "TBD" for a moment
What is the root cause of that problem?
The issue is that we are checking whether to show the "TBD" here:
App/src/components/ReportActionItem/ReportPreview.js
Line 126 in a2bdeea
App/src/components/ReportActionItem/ReportPreview.js
Lines 149 to 151 in a2bdeea
The logic to determine this variable is the following:
App/src/libs/ReportUtils.js
Lines 669 to 678 in 950f37a
It returns
trueif the transactions list is empty.When the user receives "Send money", this IOU report doesn't contain the transactions.
What changes do you think we should make in order to solve the problem?
We should modify the
ReportUtils.hasOnlyDistanceRequestTransactionsfunction to return false if there are no transactions in the report:However, the report preview will still flicker, just with different data: it'll show "owes: {amount}" which will be changed to "{user} paid: {amount}" on the following re-render.
I believe we are facing the Onyx updates order issue here once again #28737 (comment)
The Pusher sends data in the correct order: first, the IOU Report and the Transaction, and only then – the REPORTPREVIEW report action. But the ReportView component is rendered with the reversed data order: first, the reportAction is created, and only then – the IOU report is fetched.
What alternative solutions did you explore? (Optional)
samilabud commentedon Oct 26, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second
What is the root cause of that problem?
This is happening in all platforms but only can be appreciated in the slower ones. What occurs here is we are calling getDisplayAmount on every render and not when we need it, that's why we can see the TBD for a second before another render updates the text. Additionally, huge rerender causes slowness in the chat performance.
What changes do you think we should make in order to solve the problem?
The first thing should be to import useState and useEffect to control the huge rerendering in ReportPreview component (
https://github.com/Expensify/App/blob/55c936652796ddfee944c86b6642ab821bdcf209/src/components/ReportActionItem/ReportPreview.js)
Then we can include the next changes:
const [displayAmount, setDisplayAmount] = useState();And finally, use the const previously declared to show the amount correctly:
This is what is happening currently:
Current.Behavior.mp4
This is after changes:
After.changes.mp4
narefyev91 commentedon Oct 27, 2023
@paultsimura does correct order fix for onyx will automatically fix current issue?
paultsimura commentedon Oct 27, 2023
It should, because the
iouReportwill be present at the moment thereportActionis added, and the flickering currently happens because theiouReportis missing.However, that Onyx issue has been open for a while, and I'm curious if we'll have any progress on it anytime soon...
27 remaining items
mallenexpensify commentedon Jan 3, 2024
Commented on the PR
[-][HOLD App #30219] [$500] mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second[/-][+][$500] mWeb/Chrome - IOU-Receiver of Send money is shown TBD for a second[/+]mallenexpensify commentedon Jan 17, 2024
Off hold, #30219 hit production
@izarutskaya can you retest? I don't have an android phone handy to test with. Thx
melvin-bot commentedon Jan 17, 2024
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
hayata-suenaga commentedon Jan 18, 2024
I asked in the QA channel to get somebody test this
kbecciv commentedon Jan 18, 2024
Issue is fixed, build 1.4.27.0
az_recorder_20240118_222505.mp4
hayata-suenaga commentedon Jan 18, 2024
since this was fixed, I'm closing this issue