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
[Due for payment 2026-07-29] [$250] WS settings - Invite member from WS settings then clicking on it gives error in RHP #95725
Version Number: 9.4.32-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: N/A Email or phone of affected tester (no customers):emady.syed1234+newuser123@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Windows 11 / Chrome App Component: Workspace Settings
Please re-state the problem that we are trying to solve in this issue.
Inviting a new member from Workspace Settings › Members, then immediately clicking that just-added member row, opens the member-details RHP as a "Hmm... it's not here" not-found page instead of the member's details. Reproducible in staging and production on v9.4.32-0.
What is the root cause of that problem?
The member-details RHP resolves the member through a fragile two-hop lookup that is keyed off the route's accountID:
The two Onyx stores are keyed differently — policy.employeeList is keyed by login/email, while personalDetails is keyed by accountID — so the page must bridge them via personalDetails[accountID].login. If that bridge breaks, member is undefined and the page renders NotFoundPage.
For a brand-new invitee, the accountID in play is a client-generated optimistic hash of the email (generateAccountID(email)). When the invite API call succeeds, the optimistic personalDetails[optimisticAccountID] entry is cleaned up (set to null in finallyData) and the backend returns the real personal details under a different, real accountID. If the RHP was opened with the now-stale optimistic accountID (or the optimistic→real swap races the click), personalDetails[accountID] is undefined → memberLogin is '' → member = employeeList[''] is undefined → shouldShowNotFoundPage is true.
Optimistic employeeList (keyed by login) vs optimistic personalDetails (keyed by generated accountID): Member.ts:859-871
Note on regression scope: the not-found condition and lookup logic in this file are ~2 years old (unchanged since 2024), so the file itself did not regress. Because the bug newly surfaced in v9.4.32, the trigger is most likely an upstream data-population/timing change — the recent "personal details → useOnyx" migration series and the Member.ts onyx-store PR that was reverted on 2026-07-09. This part should be confirmed by an internal engineer before landing a fix.
What changes do you think we should make in order to solve the problem?
Make the RHP resilient to the optimistic→real accountID transition so a pending/just-invited member never falls through to the not-found page:
In WorkspaceMemberDetailsPage.tsx:97-99, don't depend solely on personalDetails[accountID].login to resolve the member. Add a fallback that resolves the login for the route accountID directly from the policy (e.g., reverse-map via getMemberAccountIDsForWorkspace(policy?.employeeList) — which the members list already uses to navigate — and pick the login whose accountID matches the route param). This keeps member resolvable even while personalDetails[accountID] is momentarily null.
Guard shouldShowNotFoundPage (:275-280) so it does not trigger for a member that is still pendingAction: 'add' (invite in flight).
What alternative solutions did you explore?
Alternatively, fix it at the source by ensuring the members-list navigation and the details-page lookup key off the same stable identifier during the optimistic window — either navigate with the login/email rather than the transient optimistic accountID, or keep the optimistic personalDetails[optimisticAccountID] entry until the real entry is confirmed rather than nulling it in finallyData.
Related issues
Expensify/App#91649 — "It's not here" screen shown in member RHP after removal (same not-found path, different trigger).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/95725) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
⚠️ Medium confidence — the root-cause mechanism is code-supported, but the exact regression window (recent useOnyx personal-details migration) needs runtime confirmation before implementing.
Please re-state the problem that we are trying to solve in this issue.
When we invite a brand-new user from Workspace settings > Members and then click on that member, the member details RHP opens correctly for a moment and then turns into the "Hmm... it's not here" (not found) page, even though the member was added successfully.
What is the root cause of that problem?
When we invite an email that has no existing personal details record, the app creates an optimistic personal detail keyed by a locally generated optimistic accountID, and registers a cleanup for it that runs when AddMembersToWorkspace succeeds, because the backend returns the same user under their real accountID:
The members list maps each employee's email to an accountID through the personal details list, so clicking the just-invited member navigates to WORKSPACE_MEMBER_DETAILS with the optimistic accountID in the route. WorkspaceMemberDetailsPage then resolves everything from that route param:
When the AddMembersToWorkspace response lands (that's the moment the panel flips in the repro video), the optimistic personal detail is set to null and the member now only exists under their real accountID. The already-open RHP still has the stale optimistic accountID in its route, so memberLogin resolves to '', member becomes undefined, and the page falls into the not-found branch permanently:
What changes do you think we should make in order to solve the problem?
In WorkspaceMemberDetailsPage, when the route's accountID stops resolving to a login (the optimistic record was just cleaned up), re-resolve the member's real accountID from the login we were already displaying and point the route at it. PersonalDetailsUtils.getKnownAccountIDByLogin is exactly suited for this since it only returns accountIDs that actually exist in personal details and never fabricates optimistic ones:
constprevMemberLogin=usePrevious(memberLogin);useEffect(()=>{// Once AddMembersToWorkspace succeeds, the optimistic personal detail is cleared and the member// only exists under their real accountID, so re-resolve it from the login we were showing.if(memberLogin||!prevMemberLogin){return;}constrealAccountID=getKnownAccountIDByLogin(prevMemberLogin);if(!realAccountID||realAccountID===accountID){return;}Navigation.setParams({accountID: String(realAccountID)});},[memberLogin,prevMemberLogin,accountID]);
usePrevious is already used in this page and getKnownAccountIDByLogin just needs to be added to the existing @libs/PersonalDetailsUtils import. Updating the param in place keeps the RHP mounted, re-renders it with the member's real data, and means any page opened from here (role, custom fields, profile) also receives the real accountID. If the member was genuinely removed, the login lookup fails and the not-found page still shows as before.
What specific scenarios should we cover in automated tests to prevent reoccurrence of this issue?
Render WorkspaceMemberDetailsPage for a freshly invited member (optimistic accountID in the route, optimistic personal detail and employeeList entry in Onyx), then apply the success reconciliation (optimistic personal detail nulled, real accountID entry added, pendingAction cleared) and assert the page updates the route to the real accountID and keeps showing the member details instead of the not-found page.
Assert the not-found page still renders when the member is actually removed from the policy's employeeList.
What alternative solutions did you explore? (Optional)
Resolving the login by reverse lookup instead of usePrevious: the optimistic accountID is a deterministic hash of the login (generateAccountID), so the page could scan policy.employeeList for an email whose generated ID matches the route accountID and redirect to the real one. This would additionally cover refreshing/deep-linking a stale optimistic URL, but it scans the employee list and adds a dependency on how optimistic IDs are generated; the targeted fix above covers the reported flow more simply.
Keeping the optimistic personal detail around until the real record arrives (dropping the cleanup from successData). Rejected: the cleanup exists precisely to avoid duplicate personal detail entries once the backend returns the real accountID.
Disabling the member row while the invite is still pending (similar to how optimistic participants are disabled elsewhere). This avoids the race but blocks admins from opening a member they just added even when online, which is a worse experience than fixing the page itself.
Please re-state the problem that we are trying to solve in this issue.
On Web (Windows/Chrome, staging & production), after inviting a member from Workspace Settings > Members and then clicking the newly-added row, the Right Hand Panel opens WorkspaceMemberDetailsPage and renders the NotFound error page instead of the member's details. Expected: the RHP should show the member's details without any error.
What is the root cause of that problem?
WorkspaceMemberDetailsPage resolves the member by chaining accountID → personalDetails[accountID].login → policy.employeeList[login] at src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx:97-99. For a just-invited member, the row in WorkspaceMembersPage (src/pages/workspace/WorkspaceMembersPage.tsx:300) navigates with the invitee's accountID, but the optimistic Onyx data written by addMembersToWorkspace / buildAddMembersToWorkspaceOnyxData populates policy.employeeList keyed by login while personalDetails[accountID] for that new invitee is not yet available. That makes memberLogin an empty string at line 98, member = policy.employeeList[''] becomes undefined at line 99, so shouldShowNotFoundPage at lines 276-277 is true and the NotFoundPage at line 280 is rendered inside the RHP.
What changes do you think we should make in order to solve the problem?
In src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx:98-99, fall back to locating the employee by scanning policy.employeeList for an entry whose accountID matches the route accountID when personalDetails?.[accountID]?.login is empty — this covers the optimistic window where personalDetails hasn't populated yet.
Alternatively (or additionally), at src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx:276-277, only treat the page as NotFound after a short optimistic grace period when personalDetails[accountID] is missing but accountID is present in policy.employeeList values, so freshly-invited members don't briefly render the error page.
In src/libs/actions/Policy/Member.ts (buildAddMembersToWorkspaceOnyxData, called from addMembersToWorkspace at line 976), ensure the optimistic Onyx data also writes a minimal personalDetails[accountID] = { login, accountID, ... } entry for each newly invited member so the reverse lookup on the details page succeeds immediately after invite.
Verify WorkspaceMembersPage.openMemberDetails at src/pages/workspace/WorkspaceMembersPage.tsx:292-304 passes the same accountID that is written into the optimistic personalDetails from step 3 (from invitedEmailsToAccountIDs), so the two ends of the lookup agree.
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
After inviting a member from Workspace Settings → Members, clicking the just‑added (still‑optimistic) member opens the member details RHP, which then flips to a "page not found" error.
What is the root cause of that problem?
Just‑invited members are rendered optimistically in the members table, and their row is clickable when it should not be.
WorkspaceMembersPage builds each row with an isInteractive flag specifically meant to block interaction while the member's personal details are optimistic:
<Table.Rowinteractive// ← hardcoded; item.isInteractive never useddisabled={item.disabled}onPress={item.action}>
(Note disabled is computed only from DELETE/errors — WorkspaceMembersPage.tsx:394disabled: isPendingDeleteOrError — so it is false for an ADD-optimistic member. isInteractive is the intended gate, and Table.Row already honors !interactive to suppress onPress — src/components/Table/TableRow.tsx:156.)
The consequence: openMemberDetails (WorkspaceMembersPage.tsx:292-304) navigates to WORKSPACE_MEMBER_DETAILS using the optimistic accountID. For a brand‑new invitee this ID is the synthetic hash from getUserToInviteOption → generateAccountID(login) (src/libs/PersonalDetailOptionsListUtils/index.ts, src/libs/UserUtils.ts:216), not a real account.
WorkspaceMemberDetailsPage resolves the member via that accountID:
While optimistic, the page renders fine. But when the invite request succeeds, the optimistic personal detail is wiped: getPersonalDetailsOnyxDataForOptimisticUsers emits finallyData with personalDetails[accountID] = null (Onyx merge‑delete), applied in buildAddMembersToWorkspaceOnyxData (src/libs/actions/Policy/Member.ts:919-920). The real member lands under a different accountID. The details page (which receives personalDetails reactively) re‑renders: personalDetails[accountID] is now undefined → memberLogin = '' → member is undefined → shouldShowNotFoundPage = !member fires (WorkspaceMemberDetailsPage.tsx:276-281) → NotFoundPage, the error shown. Because the route param is pinned to the deleted optimistic accountID, the error persists.
This is why it reproduces on the freshly added member: the user clicks it during the optimistic window, and the cleanup on success strands the open page on a dead accountID.
What changes do you think we should make in order to solve the problem?
Wire the already‑computed flag to the row so optimistic members are not clickable until their personal details are real.
Add the field to the row type — src/components/Tables/WorkspaceMembersTable/index.tsx:25-41:
Consume it in src/components/Tables/WorkspaceMembersTable/WorkspaceMembersTableRow.tsx:58:
<Table.Rowinteractive={item.isInteractive}...
Now an isOptimisticPersonalDetail member renders as non‑interactive; once success replaces the optimistic detail with the real one (isOptimisticPersonalDetail cleared), isInteractive becomes true and the row is tappable, navigating with the real accountID. No changes to navigation or the details page are needed.
After a member is invited from Workspace Settings > Members, the newly added row is rendered optimistically before the backend confirms the invite and assigns a real accountID. Clicking that row navigates to the member details RHP, which is keyed by the member's accountID from the route. For a just-invited member the details page tries to resolve the member from policy.employeeList and the matching personal details, but the optimistic entry does not yet have a resolvable accountID/personal details record, so the page falls into its NotFound/error state instead of showing member details.
Part of the render path also runs the invited login through formatPhoneNumber, which calls parsePhoneNumber. When the invited value is a brand-new login that does not yet exist in personal details, the lookup returns nothing usable and the RHP has no valid member object to display:
The gap: the member row is clickable and navigates by accountID before that accountID is valid, so the RHP cannot find the member and shows an error.
What changes do you think we should make in order to solve the problem?
In the workspace member details flow, guard resolution of the invited member so an optimistic (not-yet-confirmed) member does not route to an error. When the member cannot be resolved by accountID, fall back to matching by their optimistic login in policy.employeeList rather than treating it as NotFound.
Ensure the phone/display formatting used for the invited member does not fail when personal details are missing. formatPhoneNumber already returns the raw string when parsePhoneNumber is not valid, so the fix is to pass the invited login through this path only after confirming a member object exists:
Until the invite is confirmed and a valid accountID exists, either keep the row non-navigable or route using the optimistic login so the RHP always has a member to render, removing the error state.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-09 16:40:27 UTC.
Proposal
What is the root cause of that problem?
For a brand-new invitee, the workspace invite picker creates a client-side optimistic accountID from the typed login, and the invite flow stores that accountID in the invite draft that is later passed to addMembersToWorkspace.
addMembersToWorkspace then writes the optimistic member into policy.employeeList keyed by login and writes an optimistic personalDetails entry keyed by that generated accountID. On success, it also cleans up that optimistic personal detail because the backend is expected to provide the real personal detail under the real accountID.
The members page already knows optimistic personal details are not stable and sets isInteractive: !details.isOptimisticPersonalDetail, but the table row ignores that flag and always passes interactive to Table.Row. This lets the user open the just-added optimistic member row with the temporary accountID.
Once the optimistic personal detail is cleaned up, the already-open details RHP is still on /workspaces/:policyID/members/:accountID with the temporary accountID. WorkspaceMemberDetailsPage derives the member only from personalDetails[accountID].login, so that lookup becomes empty, policy.employeeList[''] is undefined, and the RHP renders NotFoundPage. The video shows this exact timing: the member details first render, then the same route flips to "Hmm... it's not here" without a new navigation.
What changes do you think we should make in order to solve the problem?
First, wire the existing optimistic-row guard through the table. Add isInteractive to WorkspaceMemberRowData and pass interactive={item.isInteractive} from WorkspaceMembersTableRow so rows backed by optimistic personal details are not clickable until the real member data is available.
Second, make WorkspaceMemberDetailsPage resilient for an RHP that is already open when the optimistic accountID is cleaned up. Keep the last non-empty member login/details for the current route, and when personalDetails[accountID] disappears but that previous login still exists in policy.employeeList, resolve the real accountID with getKnownAccountIDByLogin(previousLogin) and replace the current member details route with the real accountID. Until that replacement happens, keep rendering from the previous login/details instead of treating the valid workspace member as not found. Preserve the existing not-found behavior when the member is actually removed from policy.employeeList or is pending delete.
Add a unit/component test that renders the member details RHP with an optimistic accountID, then applies the success reconciliation where the optimistic personal detail is removed and the real personal detail is added, and assert the page keeps showing the member instead of NotFoundPage.
Add coverage that the details page replaces or navigates to the real accountID once getKnownAccountIDByLogin(previousLogin) can resolve it.
Add a table-row test or workspace members test proving an isOptimisticPersonalDetail row receives interactive={false} and does not call openMemberDetails.
Keep a regression assertion that an actually removed member still renders the not-found page.
What alternative solutions did you explore? (Optional)
We could change the member details route to include the member login instead of only accountID, but that widens the route contract and every nested member RHP route would need to be updated.
We could also keep the optimistic personal detail around after success, but that cleanup exists to avoid duplicate personal details once the backend returns the real accountID.
Only disabling optimistic rows would prevent the easiest repro, but it would not recover an RHP that was already opened before the success cleanup landed. The details page still needs the stale-route recovery to avoid flipping from a valid member panel to not-found.
@daledah The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
applause-bot commentedon Jul 9, 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/887f5e6f8f91cfaf835f64e04d3aa73ddd3e6dc56d7bec531ab8c422ad57af90
MelvinBot commentedon Jul 9, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Inviting a new member from Workspace Settings › Members, then immediately clicking that just-added member row, opens the member-details RHP as a "Hmm... it's not here" not-found page instead of the member's details. Reproducible in staging and production on v9.4.32-0.
What is the root cause of that problem?
The member-details RHP resolves the member through a fragile two-hop lookup that is keyed off the route's
accountID:accountID→personalDetails[accountID].login→employeeList[login]The two Onyx stores are keyed differently —
policy.employeeListis keyed by login/email, whilepersonalDetailsis keyed by accountID — so the page must bridge them viapersonalDetails[accountID].login. If that bridge breaks,memberisundefinedand the page rendersNotFoundPage.For a brand-new invitee, the
accountIDin play is a client-generated optimistic hash of the email (generateAccountID(email)). When the invite API call succeeds, the optimisticpersonalDetails[optimisticAccountID]entry is cleaned up (set tonullinfinallyData) and the backend returns the real personal details under a different, real accountID. If the RHP was opened with the now-stale optimistic accountID (or the optimistic→real swap races the click),personalDetails[accountID]isundefined→memberLoginis''→member = employeeList['']isundefined→shouldShowNotFoundPageistrue.Code references (App @
65a29b3)WorkspaceMemberDetailsPage.tsx:97-99WorkspaceMemberDetailsPage.tsx:275-280WorkspaceMembersPage.tsx:300personalDetailsby email:PolicyUtils.ts:782-805employeeList(keyed by login) vs optimisticpersonalDetails(keyed by generated accountID):Member.ts:859-871Note on regression scope: the not-found condition and lookup logic in this file are ~2 years old (unchanged since 2024), so the file itself did not regress. Because the bug newly surfaced in v9.4.32, the trigger is most likely an upstream data-population/timing change — the recent "personal details →
useOnyx" migration series and theMember.tsonyx-store PR that was reverted on 2026-07-09. This part should be confirmed by an internal engineer before landing a fix.What changes do you think we should make in order to solve the problem?
Make the RHP resilient to the optimistic→real accountID transition so a pending/just-invited member never falls through to the not-found page:
WorkspaceMemberDetailsPage.tsx:97-99, don't depend solely onpersonalDetails[accountID].loginto resolve the member. Add a fallback that resolves the login for the routeaccountIDdirectly from the policy (e.g., reverse-map viagetMemberAccountIDsForWorkspace(policy?.employeeList)— which the members list already uses to navigate — and pick the login whose accountID matches the route param). This keepsmemberresolvable even whilepersonalDetails[accountID]is momentarilynull.shouldShowNotFoundPage(:275-280) so it does not trigger for a member that is stillpendingAction: 'add'(invite in flight).What alternative solutions did you explore?
Alternatively, fix it at the source by ensuring the members-list navigation and the details-page lookup key off the same stable identifier during the optimistic window — either navigate with the login/email rather than the transient optimistic accountID, or keep the optimistic
personalDetails[optimisticAccountID]entry until the real entry is confirmed rather than nulling it infinallyData.Related issues
Expensify/App#91649— "It's not here" screen shown in member RHP after removal (same not-found path, different trigger).Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/95725)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
useOnyxpersonal-details migration) needs runtime confirmation before implementing.David-2002065 commentedon Jul 9, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When we invite a brand-new user from Workspace settings > Members and then click on that member, the member details RHP opens correctly for a moment and then turns into the "Hmm... it's not here" (not found) page, even though the member was added successfully.
What is the root cause of that problem?
When we invite an email that has no existing personal details record, the app creates an optimistic personal detail keyed by a locally generated optimistic accountID, and registers a cleanup for it that runs when
AddMembersToWorkspacesucceeds, because the backend returns the same user under their real accountID:App/src/libs/PersonalDetailsUtils.ts
Lines 354 to 360 in 3b9779a
That cleanup is pushed into the command's
successDatahere:App/src/libs/actions/Policy/Member.ts
Lines 919 to 925 in 3b9779a
The members list maps each employee's email to an accountID through the personal details list, so clicking the just-invited member navigates to
WORKSPACE_MEMBER_DETAILSwith the optimistic accountID in the route.WorkspaceMemberDetailsPagethen resolves everything from that route param:App/src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
Lines 97 to 99 in 3b9779a
When the
AddMembersToWorkspaceresponse lands (that's the moment the panel flips in the repro video), the optimistic personal detail is set tonulland the member now only exists under their real accountID. The already-open RHP still has the stale optimistic accountID in its route, somemberLoginresolves to'',memberbecomesundefined, and the page falls into the not-found branch permanently:App/src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
Lines 276 to 281 in 3b9779a
What changes do you think we should make in order to solve the problem?
In
WorkspaceMemberDetailsPage, when the route's accountID stops resolving to a login (the optimistic record was just cleaned up), re-resolve the member's real accountID from the login we were already displaying and point the route at it.PersonalDetailsUtils.getKnownAccountIDByLoginis exactly suited for this since it only returns accountIDs that actually exist in personal details and never fabricates optimistic ones:usePreviousis already used in this page andgetKnownAccountIDByLoginjust needs to be added to the existing@libs/PersonalDetailsUtilsimport. Updating the param in place keeps the RHP mounted, re-renders it with the member's real data, and means any page opened from here (role, custom fields, profile) also receives the real accountID. If the member was genuinely removed, the login lookup fails and the not-found page still shows as before.What specific scenarios should we cover in automated tests to prevent reoccurrence of this issue?
WorkspaceMemberDetailsPagefor a freshly invited member (optimistic accountID in the route, optimistic personal detail andemployeeListentry in Onyx), then apply the success reconciliation (optimistic personal detail nulled, real accountID entry added,pendingActioncleared) and assert the page updates the route to the real accountID and keeps showing the member details instead of the not-found page.employeeList.What alternative solutions did you explore? (Optional)
usePrevious: the optimistic accountID is a deterministic hash of the login (generateAccountID), so the page could scanpolicy.employeeListfor an email whose generated ID matches the route accountID and redirect to the real one. This would additionally cover refreshing/deep-linking a stale optimistic URL, but it scans the employee list and adds a dependency on how optimistic IDs are generated; the targeted fix above covers the reported flow more simply.successData). Rejected: the cleanup exists precisely to avoid duplicate personal detail entries once the backend returns the real accountID.aswin-s commentedon Jul 9, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Web (Windows/Chrome, staging & production), after inviting a member from Workspace Settings > Members and then clicking the newly-added row, the Right Hand Panel opens
WorkspaceMemberDetailsPageand renders the NotFound error page instead of the member's details. Expected: the RHP should show the member's details without any error.What is the root cause of that problem?
WorkspaceMemberDetailsPageresolves the member by chainingaccountID → personalDetails[accountID].login → policy.employeeList[login]at src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx:97-99. For a just-invited member, the row inWorkspaceMembersPage(src/pages/workspace/WorkspaceMembersPage.tsx:300) navigates with the invitee'saccountID, but the optimistic Onyx data written byaddMembersToWorkspace/buildAddMembersToWorkspaceOnyxDatapopulatespolicy.employeeListkeyed by login whilepersonalDetails[accountID]for that new invitee is not yet available. That makesmemberLoginan empty string at line 98,member = policy.employeeList['']becomesundefinedat line 99, soshouldShowNotFoundPageat lines 276-277 is true and the NotFoundPage at line 280 is rendered inside the RHP.What changes do you think we should make in order to solve the problem?
policy.employeeListfor an entry whoseaccountIDmatches the routeaccountIDwhenpersonalDetails?.[accountID]?.loginis empty — this covers the optimistic window where personalDetails hasn't populated yet.personalDetails[accountID]is missing butaccountIDis present inpolicy.employeeListvalues, so freshly-invited members don't briefly render the error page.src/libs/actions/Policy/Member.ts(buildAddMembersToWorkspaceOnyxData, called fromaddMembersToWorkspaceat line 976), ensure the optimistic Onyx data also writes a minimalpersonalDetails[accountID] = { login, accountID, ... }entry for each newly invited member so the reverse lookup on the details page succeeds immediately after invite.WorkspaceMembersPage.openMemberDetailsat src/pages/workspace/WorkspaceMembersPage.tsx:292-304 passes the sameaccountIDthat is written into the optimistic personalDetails from step 3 (frominvitedEmailsToAccountIDs), so the two ends of the lookup agree.What alternative solutions did you explore? (Optional)
trasnake87 commentedon Jul 9, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After inviting a member from Workspace Settings → Members, clicking the just‑added (still‑optimistic) member opens the member details RHP, which then flips to a "page not found" error.
What is the root cause of that problem?
Just‑invited members are rendered optimistically in the members table, and their row is clickable when it should not be.
WorkspaceMembersPagebuilds each row with anisInteractiveflag specifically meant to block interaction while the member's personal details are optimistic:src/pages/workspace/WorkspaceMembersPage.tsx:384But the row component ignores it and hardcodes
interactive, so the optimistic row is always tappable:src/components/Tables/WorkspaceMembersTable/WorkspaceMembersTableRow.tsx:56-65(Note
disabledis computed only from DELETE/errors —WorkspaceMembersPage.tsx:394disabled: isPendingDeleteOrError— so it isfalsefor anADD-optimistic member.isInteractiveis the intended gate, andTable.Rowalready honors!interactiveto suppressonPress—src/components/Table/TableRow.tsx:156.)The consequence:
openMemberDetails(WorkspaceMembersPage.tsx:292-304) navigates toWORKSPACE_MEMBER_DETAILSusing the optimistic accountID. For a brand‑new invitee this ID is the synthetic hash fromgetUserToInviteOption→generateAccountID(login)(src/libs/PersonalDetailOptionsListUtils/index.ts,src/libs/UserUtils.ts:216), not a real account.WorkspaceMemberDetailsPageresolves the member via that accountID:src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx:97-99While optimistic, the page renders fine. But when the invite request succeeds, the optimistic personal detail is wiped:
getPersonalDetailsOnyxDataForOptimisticUsersemitsfinallyDatawithpersonalDetails[accountID] = null(Onyx merge‑delete), applied inbuildAddMembersToWorkspaceOnyxData(src/libs/actions/Policy/Member.ts:919-920). The real member lands under a different accountID. The details page (which receivespersonalDetailsreactively) re‑renders:personalDetails[accountID]is nowundefined→memberLogin = ''→memberisundefined→shouldShowNotFoundPage = !memberfires (WorkspaceMemberDetailsPage.tsx:276-281) →NotFoundPage, the error shown. Because the route param is pinned to the deleted optimistic accountID, the error persists.This is why it reproduces on the freshly added member: the user clicks it during the optimistic window, and the cleanup on success strands the open page on a dead accountID.
What changes do you think we should make in order to solve the problem?
Wire the already‑computed flag to the row so optimistic members are not clickable until their personal details are real.
src/components/Tables/WorkspaceMembersTable/index.tsx:25-41:src/components/Tables/WorkspaceMembersTable/WorkspaceMembersTableRow.tsx:58:Now an
isOptimisticPersonalDetailmember renders as non‑interactive; once success replaces the optimistic detail with the real one (isOptimisticPersonalDetailcleared),isInteractivebecomestrueand the row is tappable, navigating with the real accountID. No changes to navigation or the details page are needed.samranahm commentedon Jul 9, 2026
Proposal
What is the root cause of that problem?
After a member is invited from Workspace Settings > Members, the newly added row is rendered optimistically before the backend confirms the invite and assigns a real
accountID. Clicking that row navigates to the member details RHP, which is keyed by the member'saccountIDfrom the route. For a just-invited member the details page tries to resolve the member frompolicy.employeeListand the matching personal details, but the optimistic entry does not yet have a resolvableaccountID/personal details record, so the page falls into its NotFound/error state instead of showing member details.Part of the render path also runs the invited login through
formatPhoneNumber, which callsparsePhoneNumber. When the invited value is a brand-new login that does not yet exist in personal details, the lookup returns nothing usable and the RHP has no valid member object to display:App/src/libs/LocalePhoneNumber.ts
Lines 20 to 50 in 65a29b3
App/src/libs/PhoneNumber.ts
Lines 14 to 60 in 65a29b3
The gap: the member row is clickable and navigates by
accountIDbefore thataccountIDis valid, so the RHP cannot find the member and shows an error.What changes do you think we should make in order to solve the problem?
In the workspace member details flow, guard resolution of the invited member so an optimistic (not-yet-confirmed) member does not route to an error. When the member cannot be resolved by
accountID, fall back to matching by their optimisticlogininpolicy.employeeListrather than treating it as NotFound.Ensure the phone/display formatting used for the invited member does not fail when personal details are missing.
formatPhoneNumberalready returns the raw string whenparsePhoneNumberis not valid, so the fix is to pass the invitedloginthrough this path only after confirming a member object exists:App/src/libs/LocalePhoneNumber.ts
Lines 20 to 50 in 65a29b3
accountIDexists, either keep the row non-navigable or route using the optimisticloginso the RHP always has a member to render, removing the error state.What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
KJ21-ENG commentedon Jul 9, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-09 16:40:27 UTC.
Proposal
What is the root cause of that problem?
For a brand-new invitee, the workspace invite picker creates a client-side optimistic accountID from the typed login, and the invite flow stores that accountID in the invite draft that is later passed to
addMembersToWorkspace.App/src/libs/PersonalDetailOptionsListUtils/index.ts
Lines 120 to 128 in db11bf0
App/src/pages/workspace/DynamicWorkspaceInvitePage.tsx
Lines 189 to 198 in db11bf0
addMembersToWorkspacethen writes the optimistic member intopolicy.employeeListkeyed by login and writes an optimisticpersonalDetailsentry keyed by that generated accountID. On success, it also cleans up that optimistic personal detail because the backend is expected to provide the real personal detail under the real accountID.App/src/libs/actions/Policy/Member.ts
Lines 845 to 846 in db11bf0
App/src/libs/actions/Policy/Member.ts
Lines 859 to 920 in db11bf0
App/src/libs/PersonalDetailsUtils.ts
Lines 347 to 375 in db11bf0
The members page already knows optimistic personal details are not stable and sets
isInteractive: !details.isOptimisticPersonalDetail, but the table row ignores that flag and always passesinteractivetoTable.Row. This lets the user open the just-added optimistic member row with the temporary accountID.App/src/pages/workspace/WorkspaceMembersPage.tsx
Lines 371 to 397 in db11bf0
App/src/components/Tables/WorkspaceMembersTable/WorkspaceMembersTableRow.tsx
Lines 56 to 64 in db11bf0
Once the optimistic personal detail is cleaned up, the already-open details RHP is still on
/workspaces/:policyID/members/:accountIDwith the temporary accountID.WorkspaceMemberDetailsPagederives the member only frompersonalDetails[accountID].login, so that lookup becomes empty,policy.employeeList['']is undefined, and the RHP rendersNotFoundPage. The video shows this exact timing: the member details first render, then the same route flips to "Hmm... it's not here" without a new navigation.App/src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
Lines 97 to 100 in db11bf0
App/src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
Lines 276 to 280 in db11bf0
What changes do you think we should make in order to solve the problem?
First, wire the existing optimistic-row guard through the table. Add
isInteractivetoWorkspaceMemberRowDataand passinteractive={item.isInteractive}fromWorkspaceMembersTableRowso rows backed by optimistic personal details are not clickable until the real member data is available.App/src/components/Tables/WorkspaceMembersTable/index.tsx
Lines 25 to 41 in db11bf0
App/src/components/Table/TableRow.tsx
Lines 155 to 160 in db11bf0
Second, make
WorkspaceMemberDetailsPageresilient for an RHP that is already open when the optimistic accountID is cleaned up. Keep the last non-empty member login/details for the current route, and whenpersonalDetails[accountID]disappears but that previous login still exists inpolicy.employeeList, resolve the real accountID withgetKnownAccountIDByLogin(previousLogin)and replace the current member details route with the real accountID. Until that replacement happens, keep rendering from the previous login/details instead of treating the valid workspace member as not found. Preserve the existing not-found behavior when the member is actually removed frompolicy.employeeListor is pending delete.App/src/libs/PersonalDetailsUtils.ts
Lines 258 to 271 in db11bf0
App/src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
Lines 97 to 132 in db11bf0
Test coverage:
NotFoundPage.getKnownAccountIDByLogin(previousLogin)can resolve it.isOptimisticPersonalDetailrow receivesinteractive={false}and does not callopenMemberDetails.What alternative solutions did you explore? (Optional)
We could change the member details route to include the member login instead of only
accountID, but that widens the route contract and every nested member RHP route would need to be updated.We could also keep the optimistic personal detail around after success, but that cleanup exists to avoid duplicate personal details once the backend returns the real accountID.
Only disabling optimistic rows would prevent the easiest repro, but it would not recover an RHP that was already opened before the success cleanup landed. The details page still needs the stale-route recovery to avoid flipping from a valid member panel to not-found.
melvin-bot commentedon Jul 9, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @daledah (
External)melvin-bot commentedon Jul 9, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022075255901660443019
35 remaining items
melvin-bot commentedon Jul 22, 2026
@daledah The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
daledah commentedon Jul 23, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/666569
Regression Test Proposal
Test:
Actual
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-ec73-ae4d-61f1-e6dbf1b8c104melvin-bot commentedon Jul 28, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 28, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jul 30, 2026
Payment Summary
Contributor: @wildan-m paid $250 via Upwork
Contributor+: @daledah due $250 via NewDot
^ Test case created. Thx
quinthar commentedon Aug 19, 2026
Approved $250 to @daledah