Fix 'Not here' page when creating workspace for client with makeMeAdmin off#86331
Fix 'Not here' page when creating workspace for client with makeMeAdmin off#86331allgandalf wants to merge 12 commits intoExpensify:mainfrom
Conversation
Backend never adds the caller when they opt out of admin, so the optimistic data should match.
When creating a workspace for a client without keeping admin role, navigate to a confirmation page instead of the workspace page that the user won't have access to.
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
@QichenZhu Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@JmillsExpensify please hold on review, the C+ still needs to test the issue with my local dev setu |
|
@QichenZhu , For you to connect and test this correctly, lets test this in my VM, i am available between:
Does any of the above time work with you ? if not i can probably keep my VM active and then you can test according to your time. let me know |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
@allgandalf 01:30–06:30 UTC and 08:30–11:30 UTC work for me. |
…mber When makeMeAdmin=false and the owner is different, the backend never adds the caller to the workspace. The optimistic policy data should not set role=ADMIN, otherwise the workspace briefly appears in the accountant's list before being removed on server response.
| createdForClient: { | ||
| title: '¡Has creado un espacio de trabajo para tu cliente!', | ||
| description: 'Excelentes noticias 🎉. Contáctanos si necesitan ayuda con la configuración.', |
There was a problem hiding this comment.
|
An edge case: do we need a fail page when creating a workspace for a non-existent user? Screen.Recording.2026-03-26.at.8.12.39.PM.mov |
|
NAB: #admins room shows in LHN even when the current user is not the admin or owner. This also happens on Screen.Recording.2026-03-26.at.8.38.00.PM.mov |
|
good point! i think we should handle that — the backend returns a 404 when the owner email doesnt have a proper account. i'll add an error state for that. or alternatively, we could just show the generic error on the workspace page (which already happens via onyxData in the 404 response). wdyt? |
|
Mhm.. did you test this on Expensify Classic? I'm not aware of the restriction on existing accounts only. |
@QichenZhu @allgandalf were you able to test this on Classic? |
|
I'm not able to test it. I don't have an approved accountant account, and I don't know how to test OldDot using the ngrok server. |
Just started my day, will check |
Okay i tested on OD and it doesn't block, @QichenZhu i also tested on my branch locally and it works, i think there must be some issue when you tested, you can continue with checklist i think and test again , please DM me on slack when you want to test again, thanks ! |
|
@allgandalf Screen.Recording.2026-03-31.at.8.23.32.PM.mov |
|
Also, what do you think about #86331 (comment)? I think it doesn't block this PR, but blocks the original issue. |
Explanation of Change
When an approved accountant creates a workspace for a client with "Keep me as admin" toggled off, the app navigates to the workspace page where the user sees a "Not here" page because the backend never adds them as a member.
This PR fixes this by:
makeMeAdmin=falseand the owner is a different user. This matches OldDot behavior where the accountant gets a success message and does NOT navigate to the workspace.buildPolicyDatato not add the caller whenmakeMeAdmin=false, since the backend never adds them — the optimistic data now matches server behavior.Fixed Issues
$ #83995
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Screen.Recording.2026-03-26.at.10.57.24.AM.mov