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-05-22] [$250] mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn #40557
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Create a room
4.Tap header---members and invite a member
5.Navigate back to room page
6.Tap plus--- split expense-- scan
7.Upload an image using camera
8.Tap split expense
9.Note scan in progress shown in preview
10.Open the expense and note header message shown scanning
11.Navigate to LHN
Expected Result:
In room, after inviting an user& creating split scan expense must display Scan in progress message in lhn.
Actual Result:
In room, after inviting an user& creating split scan expense displays invited 1user message in LHN instead of Scan in progress message.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@zanyrenney FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.
Please re-state the problem that we are trying to solve in this issue.
When doing a split bill scan in a room, the LHN last message doesn't show Scan in progress. If we do this in, let say a group chat, the LHN last message will show Scan in progress.
What is the root cause of that problem?
If it's a chat room, the last message value will be based on the report lastAction.
The last action is taken from visibleReportActionItems object. To get visibleReportActionItems, we sort the report actions, filter it, then take the last item.
Notice that in the filter, we filter out any whisper action, which is true for scan requests while scanning. So, the scan request is never taken into consideration and the last message will be the previous message.
But as I mentioned in the first section above, this doesn't happen when we do the split bill scan in a group chat for example. That's because, for group chat, we get the last message from lastMessageText,
In OptionsListUtils.getLastMessageTextForReport, the way we get the last report action is by filtering it only with a ReportActionUtils.shouldReportActionBeVisibleAsLastAction function.
That's why the split bill scan request is taken into consideration as the last action.
What changes do you think we should make in order to solve the problem?
We should make the last action logic consistent for the last message text. In SidebarUtils itself, we have 3 ways to get the last action. One is the last action that doesn't get through the filter, two get through the filter (one filter with ReportActionUtils.shouldReportActionBeVisibleAsLastAction and the other one is the same as in SidebarUtils)
NOTE:
a. We can move the logic to store the last action to ReportActionsUtils and create a new util function called getLastActionForLastMessageText.
b. I removed the filtering condition for CREATED action because I think it's not needed. We can add it back if we want to play safe.
c. If we don't want to include a report preview while scanning, then we just need to perform step 2 above (and access the first item instead of the last as shown in step 1).
changed the title [-]mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn[/-][+][$250] mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn[/+]on Apr 22, 2024
changed the title [-][$250] mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn[/-][+][HOLD for payment 2024-05-22] [$250] mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn[/+]on May 15, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.73-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
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:
[@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
[@thesahindia] 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:
[@thesahindia] 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:
[@thesahindia] Determine if we should create a regression test for this bug.
[@thesahindia] 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.
[@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Apr 19, 2024
Triggered auto assignment to @zanyrenney (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.kavimuru commentedon Apr 19, 2024
@zanyrenney FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.
kavimuru commentedon Apr 19, 2024
This bug might be related to #vip-vsb
bernhardoj commentedon Apr 21, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
When doing a split bill scan in a room, the LHN last message doesn't show Scan in progress. If we do this in, let say a group chat, the LHN last message will show Scan in progress.
What is the root cause of that problem?
If it's a chat room, the last message value will be based on the report
lastAction.App/src/libs/SidebarUtils.ts
Lines 321 to 363 in 8616678
The last action is taken from
visibleReportActionItemsobject. To getvisibleReportActionItems, we sort the report actions, filter it, then take the last item.App/src/libs/SidebarUtils.ts
Lines 35 to 47 in 8616678
Notice that in the filter, we filter out any whisper action, which is true for scan requests while scanning. So, the scan request is never taken into consideration and the last message will be the previous message.
But as I mentioned in the first section above, this doesn't happen when we do the split bill scan in a group chat for example. That's because, for group chat, we get the last message from
lastMessageText,App/src/libs/SidebarUtils.ts
Lines 390 to 393 in 8616678
and
lastMessageTextcomes fromOptionsListUtils.getLastMessageTextForReport.App/src/libs/SidebarUtils.ts
Lines 316 to 319 in 8616678
In
OptionsListUtils.getLastMessageTextForReport, the way we get the last report action is by filtering it only with aReportActionUtils.shouldReportActionBeVisibleAsLastActionfunction.App/src/libs/OptionsListUtils.ts
Lines 568 to 569 in 8616678
In
ReportActionUtils.shouldReportActionBeVisibleAsLastAction, we will only filter out whisper messages if it's not a report preview or IOU action.App/src/libs/ReportActionsUtils.ts
Line 567 in 8616678
That's why the split bill scan request is taken into consideration as the last action.
What changes do you think we should make in order to solve the problem?
We should make the last action logic consistent for the last message text. In SidebarUtils itself, we have 3 ways to get the last action. One is the last action that doesn't get through the filter, two get through the filter (one filter with
ReportActionUtils.shouldReportActionBeVisibleAsLastActionand the other one is the same as inSidebarUtils)App/src/libs/OptionsListUtils.ts
Lines 570 to 571 in 8616678
App/src/libs/OptionsListUtils.ts
Line 569 in 8616678
App/src/libs/OptionsListUtils.ts
Lines 265 to 272 in 8616678
App/src/libs/OptionsListUtils.ts
Line 724 in 8616678
Here is the plan:
SidebarUtilsandOptionsListUtils, update the last action filter to useReportActionsUtils.shouldReportActionBeVisibleAsLastAction(reportAction).const lastReportAction = visibleReportActionItems[report?.reportID ?? ''] ?? null;App/src/libs/OptionsListUtils.ts
Lines 568 to 569 in 8616678
NOTE:
a. We can move the logic to store the last action to
ReportActionsUtilsand create a new util function calledgetLastActionForLastMessageText.b. I removed the filtering condition for CREATED action because I think it's not needed. We can add it back if we want to play safe.
c. If we don't want to include a report preview while scanning, then we just need to perform step 2 above (and access the first item instead of the last as shown in step 1).
zanyrenney commentedon Apr 22, 2024
Agree, this looks related to VIP VSB
melvin-bot commentedon Apr 22, 2024
Job added to Upwork: https://www.upwork.com/jobs/~0169b520297273f864
[-]mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn[/-][+][$250] mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn[/+]22 remaining items
[-][$250] mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn[/-][+][HOLD for payment 2024-05-22] [$250] mWeb - In room,inviting an user& creating split scan not displaying Scan in progress in lhn[/+]melvin-bot commentedon May 15, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon May 15, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.73-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-05-22. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 15, 2024
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:
zanyrenney commentedon May 22, 2024
@thesahindia please complete the checklist above before I can issue payment. Thanks!
thesahindia commentedon May 24, 2024
We were filtering out all whisper actions, which caused this.
Test case steps -
zanyrenney commentedon May 24, 2024
payment summary
paid $250 to @bernhardoj via UW.
@thesahindia is paid via ND. They are owed $250.
Closing!
JmillsExpensify commentedon May 31, 2024
$250 approved for @thesahindia