Repository navigation
[HOLD for payment 2024-07-24] [$250] Public room - User is able to leave public room when user is not logged in #43404
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Jun 10, 2024 Triggered auto assignment to @garrettmknight (
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.We think this issue might be related to the #vip-vsb
Proposal
Please re-state the problem that we are trying to solve in this issue.
Users can leave a public room without being logged in.
What is the root cause of that problem?
The leave button is displayed regardless of whether the user is anonymous or not.
App/src/pages/ReportDetailsPage.tsx
Line 207 in 60530f6
if (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy ?? null))) { What changes do you think we should make in order to solve the problem?
We need to add a condition to check for anonymous users before displaying the leave button, similar to other parts of the application.
Add
!isAnonymousUserto the condition controlling the display of the leave menu item.App/src/pages/ReportDetailsPage.tsx
Line 207 in 60530f6
if (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy ?? null))) { What alternative solutions did you explore?
Proposal
Please re-state the problem that we are trying to solve in this issue.
User is able to leave public room when user is not logged in
What is the root cause of that problem?
We have set
isAnonymousActionto true which allows the user to proceed with exiting the room but that won't happen as the user is not logged in and hence we get redirected to concierge.App/src/pages/ReportDetailsPage.tsx
Lines 207 to 212 in 60530f6
if (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy ?? null))) { items.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, translationKey: 'common.leave', icon: Expensicons.Exit, isAnonymousAction: true, What changes do you think we should make in order to solve the problem?
The expected results is to redirect the user to login page, so we need to set
isAnonymousActiontofalse.Result Video
Screen.Recording.2024-06-11.at.1.11.52.AM.mov
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace - Error page when navigating to Workspace Join link after leaving the workspace
What is the root cause of that problem?
The root cause of the problem is that in the
ReportDetailsPagewe use theReportUtils.canLeaveChatfunction instead of theReportUtils.canLeaveRoomfunction.App/src/pages/ReportDetailsPage.tsx
Line 207 in 65db650
if (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy ?? null))) { What changes do you think we should make in order to solve the problem?
Change the code snippet above and use the
ReportUtils.canLeaveRoomfunction as shown below.if (isGroupChat || (isChatRoom && ReportUtils.canLeaveRoom(report, isPolicyEmployee)))- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Jun 11, 2024 - changed the title
[-] Public room - User is able to leave public room when user is not logged in[/-][+][$250] Public room - User is able to leave public room when user is not logged in[/+]on Jun 11, 2024 Job added to Upwork: https://www.upwork.com/jobs/~012198a597d90e1a9d
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Jun 11, 2024 48 remaining items
- addedBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.and removedBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Jul 24, 2024 Triggered auto assignment to @greg-schroeder (
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.@greg-schroeder just handing this one off while I'm OOO - only awaiting the checklist. If it doesn't get done by the time I'm back I'll pick back up. Thanks!
- The PR that introduced the bug has been identified. Link to the PR: Fix leave option does not appear in group chat thread #40529
- 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: https://github.com/Expensify/App/pull/40529/files#r1690295516
- 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: N/A
Regression Test Proposal
- Log out if logged in.
- Navigate to public room link.
- Verify that "Join" button is displayed in the top right.
- Click on the public room chat header.
- Verify that there is no "Leave" button.
Adding regression test 👍
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsLOW
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: 1.4.81-3
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
Login modal will open.
Actual Result:
User is able to leave the public room, and the public room reappears.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6508355_1718037560053.bandicam_2024-06-11_00-34-48-344.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @greg-schroeder