Open IuliiaHerets opened 1 week ago
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.
@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
@zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
whoops!!!
yeh i agree this is a bug. we should look at this in ND quality.
Job added to Upwork: https://www.upwork.com/jobs/~021836832143423032683
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External
)
💰 Looking for proposal (if issue is reproducible).
Members' room names are not updated in LHN after cache deletion
When we clear the cache and restart, personalDetails
will return {isOptimisticPersonalDetail: true}
, and reportOwnerDisplayName
will be set to report?.reportName
because getDisplayNameForParticipant(ownerAccountID)
or login
will not have a value. As a result, we will see the name as Chat Report
https://github.com/Expensify/App/blob/9160fa585c26d3312fd6d6fbd69d334e66cb373d/src/libs/ReportUtils.ts#L2681
And when we send a message, personalDetails
will be updated after the AddComment
call is completed. At this point, getDisplayNameForParticipant(ownerAccountID)
will return the participant's display name, and login will also have a value. As a result, the report name will be set based on the logic we check. Therefore, reportOwnerDisplayName
will return the value from getDisplayNameForParticipant(ownerAccountID)
, and this issue will occur.
I think this is not a bug, but we need to confirm the expected behavior in this case.
If we want to keep the report name as the members' room name after clearing the cache or restarting, we can check it like this.
// .src/libs/ReportUtils.ts#L560
+ let hasResetOccurredBefore: boolean = false;
+ Onyx.connect({
+ key: ONYXKEYS.HAS_RESET_OCCURRED_BEFORE,
+ waitForCollectionCallback: true,
+ callback: (value) => {
+ hasResetOccurredBefore = value;
+ },
+ });
// .src/libs/ReportUtils.ts#L2681
- const reportOwnerDisplayName = getDisplayNameForParticipant(ownerAccountID) || login || report?.reportName;
+ const reportOwnerDisplayName = hasResetOccurredBefore
+ ? report?.reportName ?? getDisplayNameForParticipant(ownerAccountID) ?? login
+ : getDisplayNameForParticipant(ownerAccountID) ?? login ?? report?.reportName;
// .src/pages/settings/Troubleshoot/TroubleshootPage.tsx#L161
Onyx.clear(App.KEYS_TO_PRESERVE).then(() => {
+ Onyx.set(ONYXKEYS.HAS_RESET_OCCURRED_BEFORE, true);
App.openApp();
});
With that solution, we need backend support to store the key by account ID.
We should use the report name instead of the participant's name.
// .src/libs/ReportUtils.ts#L2681
- const reportOwnerDisplayName = getDisplayNameForParticipant(ownerAccountID) || login || report?.reportName;
+ const reportOwnerDisplayName = report?.reportName;
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.34-2 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4960406 Email or phone of affected tester (no customers): sustinov@applausemail.com Issue reported by: Applause Internal Team
Action Performed:
Prerequisites: Create a WS and add two employees to it
Steps:
Expected Result:
Members' room names should be updated and display the room name in LHN after the cache is deleted
Actual Result:
Members' room names are not updated in LHN after cache deletion
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/db29d7ee-4e4f-4f86-bd16-b4964ab8931c
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @ikevin127