Repository navigation
Description
Problem
On the workspace Rooms page, opening the page fires the OpenPolicyRoomsPage command with only a policyID and no pagination parameters. The backend returns every room (policyExpenseChat) for the workspace in a single response, and the frontend table renders the entire list with infinite scroll and no paging.
For very large workspaces (tens of thousands of members → tens of thousands of rooms), this means a single request tries to return all rooms at once. This has been observed taking ~47s to complete for an admin on a workspace with ~22k members, which contributes to long skeleton/loading states on that page.
Current behavior
WorkspaceRoomsPagerequests all rooms on focus with no pagination:App/src/pages/workspace/rooms/WorkspaceRoomsPage.tsx
Lines 88 to 90 in 2f02df8
return; } Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID));
openPolicyRoomsPagesends only{policyID}:App/src/libs/actions/Policy/Room.ts
Lines 10 to 26 in 2f02df8
function openPolicyRoomsPage(policyID: string) { const params: OpenPolicyRoomsPageParams = {policyID}; const finallyData: Array<OnyxUpdate<typeof ONYXKEYS.ARE_POLICY_ROOMS_LOADED>> = [ { onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.ARE_POLICY_ROOMS_LOADED, value: { [policyID]: true, }, }, ]; read(READ_COMMANDS.OPEN_POLICY_ROOMS_PAGE, params, {finallyData}); }
- The list/table renders the full result set with no server-side paging.
Impact
- Slow initial load and long loading skeletons on the Rooms page for large workspaces.
- Large single API response and heavy client-side list rendering.
- Scales linearly with member count, so it gets worse as a workspace grows.
Proposed solution
Design and introduce pagination for the Rooms flow, end to end:
- Add pagination parameters (page size / cursor or offset, and optionally a search term) to the
OpenPolicyRoomsPagecommand and its backend implementation. - Return rooms in bounded pages instead of the full set.
- Update the frontend (
openPolicyRoomsPageaction +WorkspaceRoomsPage/WorkspaceRoomsTable) to request pages on demand (infinite scroll / "load more") and to support server-side search so admins on huge workspaces can find a room without loading everything.
Open design questions to settle in the issue:
- Page size and cursor vs. offset pagination.
- Whether search/filter should be server-side for large workspaces.
- How this interacts with the ongoing table-component refactor.
Context: reported while investigating slow loads for a large enterprise workspace; the OpenPolicyRooms response was the dominant cost (~47s) for an admin on a ~22k-member workspace.
Issue Owner
Current Issue Owner: @hoangzinhMetadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
hungvu193 commentedon Jul 31, 2026
on it 👀
hungvu193 commentedon Jul 31, 2026
@mountiny Do we need to create a separate BE issue for this one? We might need to paginate + add query params to search the room name.
mountiny commentedon Jul 31, 2026
I think you can keep it as part of this issue, yeah I agree the search will need to be updated too
hungvu193 commentedon Aug 3, 2026
All there PRs are ready for review, but we should wait for the first Auth PR to be deployed.
https://github.com/Expensify/Auth/pull/23377 is ready for your review @mountiny
25 remaining items
melvin-bot commentedon Sep 7, 2026
@hoangzinh Huh... This is 4 days overdue. Who can take care of this?
hoangzinh commentedon Sep 8, 2026
Updates: we're still working through the PR #97665
melvin-bot commentedon Sep 15, 2026
@hoangzinh Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Sep 17, 2026
@hoangzinh Eep! 4 days overdue now. Issues have feelings too...
hoangzinh commentedon Sep 18, 2026
The App PR will be merged soon #97665
hungvu193 commentedon Sep 23, 2026
The automation has failed I guess. App PR hit prod 2 days ago.
hoangzinh commentedon Sep 23, 2026
@hungvu193, do we have any other App PRs coming up, or are we all set?
hungvu193 commentedon Sep 23, 2026
We're all set here 😃
hoangzinh commentedon Sep 23, 2026
Should we close this issue then? I have a payment issue here #101777
hungvu193 commentedon Sep 23, 2026
Sure.
jayeshmangwani commentedon Dec 2, 2026
Returning early when offline prevented
openPolicyRoomsPagefrom being called. As a result,isLoadedremained undefined, causing the Rooms page to show a loader while offline #107079. We've fixed this here: #107303