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
[Due for payment 2025-04-14] [$250] Search - 1:1 DM preview in the search router does not display "You" as the sender #58939
Version Number: 9.1.17-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers):applausetester+kok1@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Mac 15.3 / Chrome App Component: Search
Action Performed:
Go to staging.new.expensify.com
Create a new workspace.
Go to workspace chat.
Send a message.
Open a DM.
Send a message.
Right click on the DM message > Reply in thread.
Send a reply in thread.
Note that LHN preview for three reports above show the sender "You".
Open search router.
Expected Result:
All the report previews in the search router will show the sender "You".
Actual Result:
Only the DM message in Step 6 does not show the sender "You" in the search router preview.
It leads to lastActorDisplayName will be undefined
What changes do you think we should make in order to solve the problem?
We can add the new variable to check if it is from the Search Router, we will consider the current user as a participant and pass it as true in OptionsListContextProvider component
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Or we can check if the parent of the report is 1:1 chat, we should not consider the current user as a participant to make it consistent
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can create a test for createOption by passing a DM report and other params and verify that when the last actor is the current user, You is included for the alternate text.
What alternative solutions did you explore? (Optional)
This is pretty minor. I see the argument that it'd be nice to have these be consistent, but I am not convinced that this really has any user impact. This has probably been this way for a long time without anyone raising any issues. I recommend we wait and see if any actual customers raise this before changing the behavior.
It sounds like maybe we forgot to add this to the router. @nkdengineer can you please submit a follow up PR to make sure the message previews in the router are identical to message previews in the LHN?
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] 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: This was a follow up from the previous PR and the author knows about it.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
@nkdengineer@allroundexperts I don't think any payment is due here, because we should have included this in #58271 and this was handled as a follow up. Let me know if either of you disagree with that!
@joekaufmanexpensify The original ticket mentioned the changes for LHN only. I think this particular case was not defined initially and should be treated as a follow up instead.
I definitely appreciate the sentiment that you both are sharing. However, I think the intent of the initial bug report was that we would fix this everywhere, not just in one place. The initial bug report did not mention fixing it only on the LHN, it just mentioned message previews. The LHN piece was added when it got translated to the GH issue.
Philosophically, if we are experiencing a bug in multiple places, we should always strive to fix it everywhere even if a bug report only mentions one of those IMO. I see the follow up PR was a one line change too, so feels pretty reasonable to me that it would be covered in the initial bounty for the bug.
Happy to get a second opinion internally from the rest of our team if you would like me too, just LMK. But otherwise, I think we'd leave this as is.
@joekaufmanexpensify I agree with your point, especially since the follow-up PR was quite simple as well. Makes sense to keep it covered under the initial bounty in this case.
Activity
melvin-bot commentedon Mar 22, 2025
Triggered auto assignment to @joekaufmanexpensify (
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.mitarachim commentedon Mar 22, 2025
i could see little bit different behavior in Prod while reproduce this issue .
DM and message from
replay in threadnot show the senderYouScreen.Recording.2025-03-22.at.12.11.38.PM.mp4
daledah commentedon Mar 22, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Only the DM message in Step 6 does not show the sender "You" in the search router preview.
What is the root cause of that problem?
For 1:1 chat, we don't want to include the current user as a participant
App/src/libs/ReportUtils.ts
Lines 2594 to 2596 in 8deddfa
So
personalDetailMaphere will not have current userApp/src/libs/OptionsListUtils.ts
Lines 835 to 836 in 8deddfa
It leads to
lastActorDisplayNamewill be undefinedWhat changes do you think we should make in order to solve the problem?
We can add the new variable to check if it is from the Search Router, we will consider the current user as a participant and pass it as true in
OptionsListContextProvidercomponentWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Or we can check if the parent of the report is 1:1 chat, we should not consider the current user as a participant to make it consistent
bernhardoj commentedon Mar 24, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
In LHN, last message for DM shows You:, but in search, You: doesn't show.
What is the root cause of that problem?
We get the sender name by getting it from
personalDetailMap.App/src/libs/OptionsListUtils.ts
Lines 835 to 836 in 4750e38
personalDetailMaponly contains the user fromaccountIDs.App/src/libs/OptionsListUtils.ts
Line 791 in 4750e38
However, the accountID from
getParticipantsAccountIDsForDisplaydoesn't include the current user.App/src/libs/OptionsListUtils.ts
Line 1036 in 4750e38
App/src/libs/ReportUtils.ts
Lines 2594 to 2596 in 4750e38
So, when retrieving the current user details, we get nothing.
What changes do you think we should make in order to solve the problem?
Instead of using
personalDetailMap, we can just usepersonalDetailsdirectly.App/src/libs/OptionsListUtils.ts
Line 835 in 4750e38
Then, we can also apply this same logic from LHN so that in DM, the other user name won't show.
App/src/libs/SidebarUtils.ts
Lines 649 to 650 in 4750e38
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can create a test for createOption by passing a DM report and other params and verify that when the last actor is the current user, You is included for the alternate text.
What alternative solutions did you explore? (Optional)
Don't show You in DM
joekaufmanexpensify commentedon Mar 24, 2025
Not overdue. Triaging today.
joekaufmanexpensify commentedon Mar 25, 2025
This is pretty minor. I see the argument that it'd be nice to have these be consistent, but I am not convinced that this really has any user impact. This has probably been this way for a long time without anyone raising any issues. I recommend we wait and see if any actual customers raise this before changing the behavior.
bernhardoj commentedon Mar 26, 2025
@joekaufmanexpensify This is actually pretty new, added in #57038.
cc: @shawnborton
shawnborton commentedon Mar 26, 2025
It sounds like maybe we forgot to add this to the router. @nkdengineer can you please submit a follow up PR to make sure the message previews in the router are identical to message previews in the LHN?
joekaufmanexpensify commentedon Mar 26, 2025
Ah, I didn't realize this was just added. Fixing makes sense then.
37 remaining items
joekaufmanexpensify commentedon Apr 14, 2025
Bumped for checklist
allroundexperts commentedon Apr 14, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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: This was a follow up from the previous PR and the author knows about it.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Verify that
Youis displayed as the senderDo we agree 👍 or 👎
joekaufmanexpensify commentedon Apr 15, 2025
Here's issue for regression test: https://github.com/Expensify/Expensify/issues/491033
joekaufmanexpensify commentedon Apr 15, 2025
Checklist is done.
joekaufmanexpensify commentedon Apr 15, 2025
@nkdengineer @allroundexperts I don't think any payment is due here, because we should have included this in #58271 and this was handled as a follow up. Let me know if either of you disagree with that!
joekaufmanexpensify commentedon Apr 15, 2025
@nkdengineer I went ahead and ended the upwork contract without payment and closed the upwork job.
joekaufmanexpensify commentedon Apr 15, 2025
Closing this for now, as we should be all set!
allroundexperts commentedon Apr 15, 2025
@joekaufmanexpensify The original ticket mentioned the changes for LHN only. I think this particular case was not defined initially and should be treated as a follow up instead.
JmillsExpensify commentedon Jun 17, 2025
@joekaufmanexpensify thoughts on that last comment?
nkdengineer commentedon Jun 18, 2025
@joekaufmanexpensify I agree with @allroundexperts opinion here. I think we should consider this issue as a follow up issue
joekaufmanexpensify commentedon Jun 27, 2025
Thanks for flagging this. I missed this originally because the GH was closed.
joekaufmanexpensify commentedon Jun 27, 2025
I definitely appreciate the sentiment that you both are sharing. However, I think the intent of the initial bug report was that we would fix this everywhere, not just in one place. The initial bug report did not mention fixing it only on the LHN, it just mentioned message previews. The LHN piece was added when it got translated to the GH issue.
Philosophically, if we are experiencing a bug in multiple places, we should always strive to fix it everywhere even if a bug report only mentions one of those IMO. I see the follow up PR was a one line change too, so feels pretty reasonable to me that it would be covered in the initial bounty for the bug.
Happy to get a second opinion internally from the rest of our team if you would like me too, just LMK. But otherwise, I think we'd leave this as is.
nkdengineer commentedon Jul 8, 2025
@joekaufmanexpensify I agree with your point, especially since the follow-up PR was quite simple as well. Makes sense to keep it covered under the initial bounty in this case.
Thanks everyone!