-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2024-10-14] [$250] LHN - Members' room names are not updated in LHN after cache deletion #49260
Comments
Triggered auto assignment to @zanyrenney ( |
@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 ( |
💰 Looking for proposal (if issue is reproducible). |
ProposalPlease re-state the problem that we are trying to solve in this issue.Members' room names are not updated in LHN after cache deletion What is the root cause of that problem?When we clear the cache and restart, Line 2681 in 9160fa5
And when we send a message, What changes do you think we should make in order to solve the problem?I think this is not a bug, but we need to confirm the expected behavior in this case. Solution 1If 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. Solution 2We 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; |
@ikevin127, @zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@ikevin127 please could you review the proposal above? |
This comment was marked as outdated.
This comment was marked as outdated.
@huult Thanks for your proposal. Unfortunately, I don't see how any of the proposed solutions would fulfil the Expected result because even if we involve BE -> the new key would still not preserve Correct me if I'm wrong in any way or if I misunderstood the issue's expected result. Otherwise, what I'd do would be to preserve App/src/pages/settings/Troubleshoot/TroubleshootPage.tsx Lines 156 to 158 in dc74ee3
by extending |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
Line 2681 in 9160fa5
Line 3696 in 9160fa5
is true, so we always use the report name from cache data instead of calculating a new one. What changes do you think we should make in order to solve the problem?
so if the report name in cache data is What alternative solutions did you explore? (Optional) |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@ikevin127 , thank you for review. As part of the RCA, I explained that after // .src/libs/ReportUtils.ts#L2681
const reportOwnerDisplayName = getDisplayNameForParticipant(ownerAccountID) || login || report?.reportName;
1. Click `Clear cache and restart`.
2. getDisplayNameForParticipant(ownerAccountID) is undefined and login is undefined
3. report?.reportName is `Chat room`
const reportOwnerDisplayName = undefined || undefined || "Chat roo.";
So reportOwnerDisplayName will be `Chat room` After logging out and adding a new comment, getDisplayNameForParticipant(ownerAccountID) has a value because we store the value from the API response locally. This issue occurs when the member's room is restored. // .src/libs/ReportUtils.ts#L2681
const reportOwnerDisplayName = getDisplayNameForParticipant(ownerAccountID) || login || report?.reportName;
1. Add new comment.
2. getDisplayNameForParticipant(ownerAccountID) is "applausetester+sucategoy...." that is participant name
3. report?.reportName is `Chat room`
const reportOwnerDisplayName = "applausetester+sucategoy...." || "" || "Chat room";
So reportOwnerDisplayName will be `applausetester+sucategoy....` The two points described above explain why the issue occurred. Suggestions and further explanation of my proposalCase: If the user clicks 'Clear cache and restart', we use reportName. After that, if the user sends a new comment to this room, should we switch to using the participant's name for the room name, or should we continue displaying the report name as the room name? 1. User clears cache and restarts.
2. Room name displays the report name.
3. User sends a new comment.
4. Should the room name display the report name or the participant's name? Solution 1, as I mentioned in my proposal, is to continue using the report name for the room name even after the user sends a new comment. (This solution is to use the report name to display the room name). The ideal solution is to create a new key to monitor the status of whether it has been // if used `'Clear cache and restart'` ? report?.reportName : getDisplayNameForParticipant(ownerAccountID) ?? login ?? report?.reportName
+ const reportOwnerDisplayName = hasResetOccurredBefore
+ ? report?.reportName ?? getDisplayNameForParticipant(ownerAccountID) ?? login
+ : getDisplayNameForParticipant(ownerAccountID) ?? login ?? report?.reportName; Regarding the backend update, we will store that key on the server so that when a user logs in on another device, they can retrieve that key and apply the same logic for displaying the room name. |
@huult I appreciate the detailed response to my review. The reason I'm reserved in proceeding with a solution which involves BE is because, based on reviewing and testing I don't think BE changes are required to fix this issue since that would only add more computation to the issue of cache clearing which is what we're dealing with here. |
@truph01's proposal makes sense to me - if the default report name is found in the cache, recalculate to fetch the actual report name |
📣 @ikevin127 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @truph01 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@MariaHCD
And my proposal can solve this problem without needing backend changes, and I used BE to resolve the issue in the scenario above. |
Once the user logs in on Device B, we call the API that fetches the latest information anyway, correct? |
Yes, that's correct! That approach covers this case. |
PR is ready |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.45-4 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-10-14. 🎊 For reference, here are some details about the assignees on 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:
|
Regression Test ProposalPrerequisites:
Do we agree 👍 or 👎. |
payment summary @ikevin127 requires payment automatic offer (Reviewer) - paid via Upwork $250 |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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): [email protected]
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
Bug6602770_1726253910821.Recording__1601.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @zanyrenneyThe text was updated successfully, but these errors were encountered: