You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Approve-only user can join room after leaving room offline, room disappears when online #106927
Version Number: 9.5.39-2 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#106371 Email or phone of affected tester (no customers):sdmisjdinosodjisj2@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Chat Report View
Action Performed:
Precondition:
Create a Control workspace.
Invite User B with approve-only role.
Admin creates a room and invites User B to the room.
Perform the steps below as User B:
Go to staging.new.expensify.com
Open the invited room.
Go offline.
Click on the room header.
Click Leave.
Click Join.
Go online.
Expected Result:
In Step 5, after leaving room offline, user should be dropped to Concierge (similar to leaving room as guest in offline mode).
Actual Result:
In Step 5, after leaving room offline, user remains in the room.
In Step 6, user can "join" the room after leaving room offline.
In Step 7, after returning online, the room disappears despite rejoining the room offline.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Web verification was blocked because the signed-in account has no workspaces, so the required approve-only user and invited room were unavailable—not because the reported bug was reproduced. The deploy-blocker investigation identifies Enable approve-only role assignment as the likely feature-enabling trigger (medium confidence overall): existing room-leaving logic excludes guests but not approve-only members, causing the client to retain the room offline and offer Join; recommend reverting that assignment-enabling PR for containment, then correcting restricted-room Leave/Join handling for approve-only users, while noting that existing memberships remain affected and the server-side disappearance is unverified.
Step
Status
1. User B opens appSigned-in app observed, but the account could not be established as the required approve-only User B.
❌
2. Open invited room and record visibilityBlocked: Workspaces shows “No workspaces yet”; the required Control workspace and invited room are unavailable.
❌
3. Go offlineNot attempted because the required fixture is missing.
❌
4. Click room headerNot attempted because the invited room is unavailable.
❌
5. Leave and verify navigation to ConciergeNot attempted; offline navigation remains unverified.
❌
6. Check and click Join if availableNot attempted; offline Join behavior remains unverified.
Please re-state the problem that we are trying to solve in this issue.
When an approve-only workspace member (CONST.POLICY.ROLE.APPROVE_ONLY) is invited to a workspace room (visibility === CONST.REPORT.VISIBILITY.RESTRICTED), goes offline, and clicks Leave from the room header:
Instead of removing the room and navigating to Concierge (as happens for a guest member), the user stays inside the room.
The Join button appears, allowing the approve-only user to click Join while offline.
Once the user returns online, the room disappears because the backend removed their membership on LeaveRoom and rejected JoinRoom for an approve-only user on a restricted room.
What is the root cause of that problem?
In src/libs/PolicyUtils/permissions.ts:106-113, neither CONST.POLICY.ROLE.GUEST nor CONST.POLICY.ROLE.APPROVE_ONLY has access to CONST.POLICY.POLICY_FEATURE.ROOMS. Like a guest, an approve-only member cannot browse or self-join restricted workspace rooms and only has access while explicitly invited.
When PR #106371 enabled assigning the approve-only role, two places in the room Leave/Join flow still only checked for CONST.POLICY.ROLE.GUEST:
Because ReportDetailsMenuLeaveItem.tsx only passes isPolicyGuest (policy?.role === CONST.POLICY.ROLE.GUEST), isWorkspaceMemberLeavingWorkspaceRoom evaluates to true for an approve-only member leaving a restricted room.
Consequently, in leaveRoom (src/libs/actions/Report/index.ts:5909-5927, 5997-6004), optimisticData only sets notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN instead of setting reportID: null and navigating away via navigateOutOfLeavedReport.
Because canJoinChat only blocks !policyRole || policyRole === CONST.POLICY.ROLE.GUEST (instead of also blocking CONST.POLICY.ROLE.APPROVE_ONLY or checking !canMemberWrite(policy, login, CONST.POLICY.POLICY_FEATURE.ROOMS)), once notificationPreference becomes HIDDEN offline, canJoinChat returns true and surfaces the Join option.
What changes do you think we should make in order to solve the problem?
Exclude approve-only members from retaining restricted rooms on Leave:
In src/pages/DynamicReportDetailsPage/ReportDetailsMenuLeaveItem.tsx:66-87, pass isPolicyGuest || isPolicyApproveOnly(policy) (or pass policy / hasRestrictedRoomAccess) into isWorkspaceMemberLeavingWorkspaceRoomUtil so that when an approve-only member leaves a restricted room, isWorkspaceMemberLeavingWorkspaceRoom returns false, optimistically clearing the report (reportID: null) and navigating to Concierge/last accessed report just like a guest.
Add unit tests in tests/unit/ReportUtilsTest.ts and tests/actions/ReportTest.ts verifying that for a user with role: CONST.POLICY.ROLE.APPROVE_ONLY on a restricted workspace room:
isWorkspaceMemberLeavingWorkspaceRoom returns false and leaveRoom optimistically sets reportID: null and navigates away.
canJoinChat returns false.
What alternative solutions did you explore?
Checking canMemberWrite(policy, login, CONST.POLICY.POLICY_FEATURE.ROOMS) inside canJoinChat and isWorkspaceMemberLeavingWorkspaceRoom is also clean and directly aligns with ROLE_PERMISSION_BUNDLES, where GUEST and APPROVE_ONLY are the exact two roles without ROOMS permission.
Activity
applause-bot commentedon Nov 14, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/67b8a6dc5fb820c5fe626047298c1b58a4502994b1d1a35d8c928b25eff9f778
melvin-bot commentedon Nov 14, 2026
@flodnv recently merged #106371, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Nov 14, 2026
Triggered auto assignment to @luacmartins (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Nov 14, 2026
@flodnv you have been assigned to this deploy blocker because you reviewed the offending PR: #106371
github-actions commentedon Nov 14, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Nov 14, 2026
@ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #106371
melvin-bot commentedon Nov 14, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Nov 14, 2026
🤖 Web test steps verification results: ❌ fail
Web verification was blocked because the signed-in account has no workspaces, so the required approve-only user and invited room were unavailable—not because the reported bug was reproduced. The deploy-blocker investigation identifies Enable approve-only role assignment as the likely feature-enabling trigger (medium confidence overall): existing room-leaving logic excludes guests but not approve-only members, causing the client to retain the room offline and offer Join; recommend reverting that assignment-enabling PR for containment, then correcting restricted-room Leave/Join handling for approve-only users, while noting that existing memberships remain affected and the server-side disappearance is unverified.
1. User B opens app
Signed-in app observed, but the account could not be established as the required approve-only User B.2. Open invited room and record visibility
Blocked: Workspaces shows “No workspaces yet”; the required Control workspace and invited room are unavailable.3. Go offline
Not attempted because the required fixture is missing.4. Click room header
Not attempted because the invited room is unavailable.5. Leave and verify navigation to Concierge
Not attempted; offline navigation remains unverified.6. Check and click Join if available
Not attempted; offline Join behavior remains unverified.7. Return online and check room disappearance
Not attempted; reconnect behavior remains unverified.view run · view recording
cocvn157 commentedon Nov 14, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an
approve-onlyworkspace member (CONST.POLICY.ROLE.APPROVE_ONLY) is invited to a workspace room (visibility === CONST.REPORT.VISIBILITY.RESTRICTED), goes offline, and clicks Leave from the room header:guestmember), the user stays inside the room.approve-onlyuser to click Join while offline.LeaveRoomand rejectedJoinRoomfor anapprove-onlyuser on a restricted room.What is the root cause of that problem?
In
src/libs/PolicyUtils/permissions.ts:106-113, neitherCONST.POLICY.ROLE.GUESTnorCONST.POLICY.ROLE.APPROVE_ONLYhas access toCONST.POLICY.POLICY_FEATURE.ROOMS. Like aguest, anapprove-onlymember cannot browse or self-join restricted workspace rooms and only has access while explicitly invited.When PR
#106371enabled assigning theapprove-onlyrole, two places in the room Leave/Join flow still only checked forCONST.POLICY.ROLE.GUEST:isWorkspaceMemberLeavingWorkspaceRoominsrc/libs/ReportUtils.ts:15496-15502andsrc/pages/DynamicReportDetailsPage/ReportDetailsMenuLeaveItem.tsx:66-87:Because
ReportDetailsMenuLeaveItem.tsxonly passesisPolicyGuest(policy?.role === CONST.POLICY.ROLE.GUEST),isWorkspaceMemberLeavingWorkspaceRoomevaluates totruefor anapprove-onlymember leaving a restricted room.Consequently, in
leaveRoom(src/libs/actions/Report/index.ts:5909-5927, 5997-6004),optimisticDataonly setsnotificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDENinstead of settingreportID: nulland navigating away vianavigateOutOfLeavedReport.canJoinChatinsrc/libs/ReportUtils.ts:13439-13443:Because
canJoinChatonly blocks!policyRole || policyRole === CONST.POLICY.ROLE.GUEST(instead of also blockingCONST.POLICY.ROLE.APPROVE_ONLYor checking!canMemberWrite(policy, login, CONST.POLICY.POLICY_FEATURE.ROOMS)), oncenotificationPreferencebecomesHIDDENoffline,canJoinChatreturnstrueand surfaces the Join option.What changes do you think we should make in order to solve the problem?
isPolicyApproveOnlyhelper insrc/libs/PolicyUtils/permissions.ts(and re-export fromsrc/libs/PolicyUtils/index.ts):approve-onlymembers from retaining restricted rooms on Leave:src/pages/DynamicReportDetailsPage/ReportDetailsMenuLeaveItem.tsx:66-87, passisPolicyGuest || isPolicyApproveOnly(policy)(or passpolicy/hasRestrictedRoomAccess) intoisWorkspaceMemberLeavingWorkspaceRoomUtilso that when anapprove-onlymember leaves a restricted room,isWorkspaceMemberLeavingWorkspaceRoomreturnsfalse, optimistically clearing the report (reportID: null) and navigating to Concierge/last accessed report just like a guest.approve-onlymembers from joining restricted rooms incanJoinChat(src/libs/ReportUtils.ts:13440-13443):tests/unit/ReportUtilsTest.tsandtests/actions/ReportTest.tsverifying that for a user withrole: CONST.POLICY.ROLE.APPROVE_ONLYon a restricted workspace room:isWorkspaceMemberLeavingWorkspaceRoomreturnsfalseandleaveRoomoptimistically setsreportID: nulland navigates away.canJoinChatreturnsfalse.What alternative solutions did you explore?
Checking
canMemberWrite(policy, login, CONST.POLICY.POLICY_FEATURE.ROOMS)insidecanJoinChatandisWorkspaceMemberLeavingWorkspaceRoomis also clean and directly aligns withROLE_PERMISSION_BUNDLES, whereGUESTandAPPROVE_ONLYare the exact two roles withoutROOMSpermission.marcaaron commentedon Nov 16, 2026
Heads up, I'm going to demote this one because it seems fairly minor.