App icon indicating copy to clipboard operation
App copied to clipboard

[$175] Chat - Admin room is displayed in LHN when user click on the share link

Open lanitochka17 opened this issue 2 weeks ago • 13 comments

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.5.40-0 Reproducible in staging?: Yes Reproducible in production?: yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://github.com/Expensify/Expensify/issues/564870 Email or phone of affected tester (no customers): Issue reported by: Applause Internal Team Bug source: Device used: App Component:

Action Performed:

  1. [user A] Open the link www.staging.new.expensify.com
  2. [User A] Create a workspace
  3. [User A] Tap on "Overview"
  4. [User A] Tap on "More" and select "Share"
  5. [User A] Copy the URL of the workspace.
  6. [User A] Send the link to User B
  7. [User B] Open the link www.staging.new.expensify.com
  8. [User B] Open the link.
  9. [User A] Go to inbox
  10. Verify that you don't see the admin room in LHN

Expected Result:

Asp given step user A should not see the admin room in LHN

Actual Result:

admin room is displayed in LHN

Workaround:

Unknown

Platforms:

  • [ ] Android: App
  • [ ] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome / Safari

Screenshots/Videos

Bug7290798_1792475298520!admin_room_in_LHN

View all open jobs on GitHub

Upwork Automation - Do Not Edit

lanitochka17 avatar Nov 17 '26 17:11 lanitochka17

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

Job added to Upwork: https://www.upwork.com/jobs/~022122745692687025193

🤖 Web test steps verification results: ❌ fail

Two-user UI verification is unsupported in the available browser environment; none of the 10 steps ran. Source indicates that hiding an admins room containing a pending join request would suppress its intended Inbox approval entry point.

Step Status
1. A opens appNot run: two-user scenario blocked.
⚠️
2. A creates workspaceNot run.
⚠️
3. A opens OverviewNot run.
⚠️
4. A selects More → ShareNot run.
⚠️
5. A copies workspace URLNot run.
⚠️
6. A sends URL to BNo supported second identity/session.
⚠️
7. B opens appNo supported second identity/session.
⚠️
8. B opens URLNot run; the resulting server response remains unverified.
⚠️
9. A returns to InboxDependent steps could not run.
⚠️
10. Verify admins room is hiddenNeither baseline nor post-link visibility was observed.
⚠️

Preliminary analysis — low confidence

The stated expectation may conflict with the workspace approval flow; a defect is not yet established.

Source evidence and alternative explanation

This supports an alternative explanation: B opening the link may generate a legitimate approval request, making the admins room visible intentionally. It does not prove that such a request was created in this report.

Recommendation: Do not add a blanket admins-room exclusion. First capture A’s Inbox before and after B opens the link and inspect whether an unresolved join request appears. If it does, confirm the intended product behavior; if it does not, investigate what report update caused the room to become visible.


view run

MelvinBot avatar Nov 17 '26 17:11 MelvinBot

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a non-admin user (User B) joins or views a workspace via a shared link, the workspace #admins room incorrectly appears in their Left Hand Navigation (LHN).

What is the root cause of that problem?

When opening a workspace via deep-link/share URL, the client loads or receives the workspace room list including the policyAdmins room. In src/libs/SidebarUtils.ts (inside getOrderedReportViews / shouldReportBeInOptionList), the check for whether to display an admin room (report.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ADMINS) does not verify that PolicyUtils.isPolicyAdmin(policy, currentUserAccountID) or whether the active user is an admin of the workspace. Because the room object exists in Onyx, LHN displays it by default to all members who have the workspace loaded.

What changes do you think we should make in order to solve the problem?

  1. In src/libs/SidebarUtils.ts (within shouldReportBeInOptionList), add a strict check for policy admin rooms: if report.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ADMINS, verify PolicyUtils.isPolicyAdmin(policy, currentUserAccountID). If false, exclude it from the LHN options list.
  2. In src/libs/ReportUtils.ts, ensure canUserPerformWriteAction and report access guards prevent non-admin members from rendering and selecting the admin room from deep-link routing.

What alternative solutions did you explore?

Hiding the room only after an explicit server error response, but filtering it at shouldReportBeInOptionList in SidebarUtils.ts aligns with Expensify's standard RBAC client-side LHN filtering patterns.

zainrizvi0611-cmd avatar Nov 18 '26 04:11 zainrizvi0611-cmd

📣 @zainrizvi0611-cmd! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 18 '26 04:11 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0191be403aefe984cc

zainrizvi0611-cmd avatar Nov 18 '26 05:11 zainrizvi0611-cmd

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 18 '26 05:11 melvin-bot[bot]

cc @parasharrajat

This is not a bug and matches intended product behavior.

The QA step likely confuses empty admin room unpinning with actionable join requests.

  1. When User A shares the workspace in WorkspaceOverviewSharePage.tsx#L95, it renders workspace.common.shareNote.content (en.ts#L5656-L5660), which states:

"All requests to join the workspace will show up in the #admins room for your review."

  1. When User B opens the shared link, WorkspaceJoinUserPage.tsx#L45 calls inviteMemberToWorkspace. This creates an ACTIONABLE_JOIN_REQUEST report action in #admins.

  2. Because a pending request exists, isJoinRequestInAdminRoom flags the report as requiring attention.

  3. Next, shouldReportBeInOptionList surfaces #admins in User A's LHN with a GBR dot so the admin can review the request.

PR #100278 unpinned empty #admins rooms on workspace creation. However, once an actionable join request arrives, the room is no longer empty. It must appear in LHN so the admin can accept or decline the request.

If we hide #admins from User A here, admins will never see join requests in their inbox.

I think this issue should be closed as NAB.

samithreddychinni avatar Nov 18 '26 06:11 samithreddychinni

@parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

I think this is not a real issue but expected behaviour. If you agree @lanitochka17, close this issue. if you don't, let get some confirmation on slack for this.

parasharrajat avatar Nov 24 '26 08:11 parasharrajat

Hello The issue was founded during testing of EDGE test cases. Here's the link: https://github.com/Expensify/Expensify/issues/564870

lanitochka17 avatar Nov 24 '26 15:11 lanitochka17

@parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Haven't heard anything on Slack, so posted on a different channel for internal review. https://expensify.slack.com/archives/C02NK2DQWUX/p1795861125315489

parasharrajat avatar Nov 28 '26 10:11 parasharrajat