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 2023-05-22] [$1000] Avatars are not shown on bill split preview while offline #18472
Posting proposal to fix this issue once the linked PR has been merged.
Please re-state the problem that we are trying to solve in this issue.
In this issue, we can notice that when the user is offline and sends a split bill request with more than 2 participants, the avatars in the IOU preview are not displayed until the user goes back online.
What is the root cause of that problem?
To render the list of participant avatars, we use the participants array in the originalMessage for each action. Optimistically, in a split bill request, we do not add the array of participants to the originalMessage. When the user is offline and sends the Split Bill request, the optimistic action is created without the participants array. This causes the avatars to not show up.
We need to iterate the parameter participants and for each participant, push their login in an array. Once all users have been iterated, we assign this array to the originalMessage variable.
changed the title [-][HOLD - pull/18143] Avatars are not shown on bill split preview while offline[/-][+]Avatars are not shown on bill split preview while offline[/+]on May 9, 2023
changed the title [-]Avatars are not shown on bill split preview while offline[/-][+][$1000] Avatars are not shown on bill split preview while offline[/+]on May 9, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@s77rt] The PR that introduced the bug has been identified. Link to the PR:
[@s77rt] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@s77rt] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@s77rt] Determine if we should create a regression test for this bug.
[@s77rt] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The PR that introduced the bug has been identified: Not a regression but a missing case that could have been handled on Create splitBill in the client #11597
Sharing the timeline of this issue to help with the eventual analysis, calculated with this tool.
🐛 Issue created at: Fri, 05 May 2023 11:23:33 GMT
🧯 Help Wanted at: Tue, 09 May 2023 13:14:38 GMT
🕵🏻 Contributor assigned at: Tue, 09 May 2023 13:45:30 GMT
🛸 PR created at: Tue, 09 May 2023 17:35:41 GMT
🎯 PR merged at: Wed, 10 May 2023 08:51:18 GMT
⌛ Business Days Elapsed between assignment and PR merge: 1
Activity
melvin-bot commentedon May 5, 2023
Triggered auto assignment to @stephanieelliott (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon May 5, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)Julesssss commentedon May 5, 2023
We shouldn't open this issue up for contributors until this PR is deployed.
Prince-Mendiratta commentedon May 7, 2023
Proposal
Posting proposal to fix this issue once the linked PR has been merged.
Please re-state the problem that we are trying to solve in this issue.
In this issue, we can notice that when the user is offline and sends a split bill request with more than 2 participants, the avatars in the IOU preview are not displayed until the user goes back online.
What is the root cause of that problem?
To render the list of participant avatars, we use the
participantsarray in theoriginalMessagefor each action. Optimistically, in a split bill request, we do not add the array of participants to theoriginalMessage. When the user is offline and sends the Split Bill request, the optimistic action is created without theparticipantsarray. This causes the avatars to not show up.App/src/components/ReportActionItem/IOUPreview.js
Line 140 in d120f6a
When the user goes back online, the
participantsarray is returned by the backend, causing the avatars to show up.This issue does not happen when there are just 2 users as in such a case, a different source is used to fetch user logins.
What changes do you think we should make in order to solve the problem?
We should add the
participantsarray to theoriginalMessageoptimistically as well. This can be done here:App/src/libs/ReportUtils.js
Lines 1158 to 1160 in d120f6a
We need to iterate the parameter
participantsand for each participant, push theirloginin an array. Once all users have been iterated, we assign this array to theoriginalMessagevariable.Results
2023-05-08.00-37-45.mp4
stephanieelliott commentedon May 8, 2023
Sounds good, PR is still under review so will hold on applying any labels.
Julesssss commentedon May 9, 2023
THanks @stephanieelliott. We merged the PR, so please feel free to apply the label now
[-][HOLD - pull/18143] Avatars are not shown on bill split preview while offline[/-][+]Avatars are not shown on bill split preview while offline[/+][-]Avatars are not shown on bill split preview while offline[/-][+][$1000] Avatars are not shown on bill split preview while offline[/+]25 remaining items
melvin-bot commentedon May 15, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
s77rt commentedon May 15, 2023
Regression Test Proposal
Suggested test case C1971182.
Prince-Mendiratta commentedon May 15, 2023
Sharing the timeline of this issue to help with the eventual analysis, calculated with this tool.
🐛 Issue created at: Fri, 05 May 2023 11:23:33 GMT
🧯 Help Wanted at: Tue, 09 May 2023 13:14:38 GMT
🕵🏻 Contributor assigned at: Tue, 09 May 2023 13:45:30 GMT
🛸 PR created at: Tue, 09 May 2023 17:35:41 GMT
🎯 PR merged at: Wed, 10 May 2023 08:51:18 GMT
⌛ Business Days Elapsed between assignment and PR merge: 1
Julesssss commentedon May 24, 2023
Hey @stephanieelliott, I think this one is ready for payment.
stephanieelliott commentedon May 25, 2023
Upwork job offered to @Prince-Mendiratta and @s77rt, please accept when you have a sec and I can issue payment!
s77rt commentedon May 25, 2023
Accepted!
Prince-Mendiratta commentedon May 25, 2023
Accepted ✅
stephanieelliott commentedon May 30, 2023
All paid up, thank you!