Skip to content

[HOLD for payment 2024-07-24] [$250] Public room - User is able to leave public room when user is not logged in #43404

Description

@izarutskaya

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:

  1. Go to staging.new.expensify.com
  2. Log out if logged in.
  3. Navigate to public room link.
  4. Click on the public room chat header.
  5. Click Leave.

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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6508355_1718037560053.bandicam_2024-06-11_00-34-48-344.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012198a597d90e1a9d
  • Upwork Job ID: 1800460939784883037
  • Last Price Increase: 2024-06-11
  • Automatic offers:
    • situchan | Reviewer | 102730618
    • codinggeek2023 | Contributor | 102730619
    • truph01 | Contributor | 102895803
Issue OwnerCurrent Issue Owner: @greg-schroeder

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 10, 2024
  2. melvin-bot commented on Jun 10, 2024

    @melvin-bot

    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.

  3. izarutskaya commented on Jun 10, 2024

    @izarutskaya
    Author

    We think this issue might be related to the #vip-vsb

  4. devguest07 commented on Jun 10, 2024

    @devguest07
    Contributor

    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.

    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.

    https://github.com/Expensify/App/blob/60530f643b30f30510914ed28e2a90ed5d37184a/src/pages/home/report/ReportFooter.tsx#L91C12-L91C27

    Add !isAnonymousUser to the condition controlling the display of the leave menu item.

    if (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy ?? null))) {

    What alternative solutions did you explore?

  5. eucool commented on Jun 10, 2024

    @eucool
    Contributor

    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 isAnonymousAction to 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.

    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 isAnonymousAction to false.

    Result Video

    Screen.Recording.2024-06-11.at.1.11.52.AM.mov
  6. Tony-MK commented on Jun 11, 2024

    @Tony-MK
    Contributor

    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 ReportDetailsPage we use the ReportUtils.canLeaveChat function instead of the ReportUtils.canLeaveRoom function.

    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.canLeaveRoom function as shown below.

    if (isGroupChat || (isChatRoom && ReportUtils.canLeaveRoom(report, isPolicyEmployee))) 
    
  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 11, 2024
  8. 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
  9. melvin-bot commented on Jun 11, 2024

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 11, 2024
  11. 48 remaining items

  12. removed their assignment
    on Jul 24, 2024
  13. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 24, 2024
  14. melvin-bot commented on Jul 24, 2024

    @melvin-bot

    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.

  15. garrettmknight commented on Jul 24, 2024

    @garrettmknight
    Contributor

    @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!

  16. situchan commented on Jul 24, 2024

    @situchan
    Contributor

    Regression Test Proposal

    1. Log out if logged in.
    2. Navigate to public room link.
    3. Verify that "Join" button is displayed in the top right.
    4. Click on the public room chat header.
    5. Verify that there is no "Leave" button.
  17. greg-schroeder commented on Jul 24, 2024

    @greg-schroeder
    Contributor

    Adding regression test 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

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

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions