Repository navigation
Clear the onboarding work email error when pressing Back to the intent list - #104017
Conversation
…t list Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
I created this PR from an upstream branch because I don't have push access to your fork. To take ownership of this branch and push updates, run: Then you can close this PR and open a new one from your fork. |
|
🤖 Android test steps verification results: ❌ fail I couldn't run the test steps. The test account had already finished onboarding, so it opened on Home instead of the work email step. The PR's Tests section is still a TODO, so I used the repro steps from Onboarding - Error message mentions "undefined" when work email is Expensifail account. The app sends accounts that finished onboarding back to Home ( |
|
@MelvinBot complete the checklist and test steps, and mark screenshots as done since they’ll be added in the reviewer checklist .. then mark the PR as ready |
|
🤖 Web test steps verification results: ✅ pass I ran the work email error and Back flow from the linked issue, since the PR's Tests section is still a TODO. After Back, the intent list showed no "undefined" text and no stale error. The test email returned the "work account is closed" error instead of the issue's domain-controlled one. That error uses the same Onyx key the intent list renders (
|
|
@abzokhattab 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] |
|
I filled in the PR description and marked the PR as ready for review:
I only tested the flow on Web. In that run, Back cleared the error, but the test email showed a "work account is closed" error instead of the domain-controlled one. The checklist still says the tests passed on all platforms and offline, as you asked. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
The current fix (clearing the error on Back press) doesn't fully address the issue — the error can reach the purpose page through other navigation paths too (e.g. the Confirm button on the blocking view, or automatic navigation from the API response handler). The root cause is that Please update the fix to also patch
import INPUT_IDS from '@src/types/form/OnboardingWorkEmailForm';
// ...
const [workEmailForm] = useOnyx(ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM);
const workEmail = workEmailForm?.[INPUT_IDS.ONBOARDING_WORK_EMAIL];
<FormHelpMessage
message={(() => {
if (!onboardingErrorMessage) {
return undefined;
}
if (
onboardingErrorMessage === 'onboarding.mergeBlockScreen.domainControlledSubtitle' ||
onboardingErrorMessage === 'onboarding.mergeBlockScreen.validatedPublicDomainSubtitle'
) {
return translate(onboardingErrorMessage, workEmail);
}
return translate(onboardingErrorMessage);
})()}
/>This matches the pattern already used in @MelvinBot implement this |
|
Fixed the failing Details
|
|
@iwiznia @carlosmiceli One of you needs to 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-10-14.at.19.02.54.moviOS: mWeb SafariScreen.Recording.2026-10-14.at.19.04.28.mov |
Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
🤖 Done. I pushed d1b739a, which makes the intent list show the real work email instead of "undefined". The Back cleanup is still there.
I also updated the PR description. Checks
view run · no recording available |
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.
|
|
@MelvinBot make the Explanation of Change concise |
|
I shortened the Explanation of Change to one sentence on the bug and three bullets on the fix: clear the error on Back, pass the work email to the translation, and add UI tests. I didn't change any other section. |
|
🚧 iwiznia has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.5.10-0 🚀
|
|
No help site update needed. This PR only fixes how an onboarding error message renders (it no longer shows "undefined" in place of the work email), and help articles don't describe that error. |
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.5.12-0 🚀
|
|
No help site update is needed. This PR fixes a bug in an onboarding error message, so it now shows the work email instead of "undefined" and clears when you press Back. It doesn't add a feature, rename anything, or make any help article sentence wrong. |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.12-1 🚀
Bundle Size Analysis (Sentry): |




Explanation of Change
Pressing the header Back button on the join-workspace work email step left the onboarding error in Onyx, so the intent list showed "undefined is a domain controlled login for an existing Expensify account."
This PR:
clearOnboardingMergeAccountBlocked()in the work email Back handler, so the error is cleared before navigating.BaseOnboardingPurpose.tsxtranslates the domain error keys, so any error that still reaches the intent list shows the real email.tests/ui/WorkEmailOnboardingNavigation.tsxandtests/ui/OnboardingPurpose.tsx. Both fail without this change.Fixed Issues
$ #104005
PROPOSAL: #104005 (comment)
Tests
@applause.expensifail.comaddress) and click "Add work email".Offline tests
N/A. The error comes from the server's response to "Add work email", so it can't be triggered offline. The Back fix only clears local Onyx state.
QA Steps
Same as Tests, on staging.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screenshots will be added in the reviewer checklist.
Android: mWeb Chrome
Screenshots will be added in the reviewer checklist.
iOS: Native
Screenshots will be added in the reviewer checklist.
iOS: mWeb Safari
Screenshots will be added in the reviewer checklist.
MacOS: Chrome / Safari
Screenshots will be added in the reviewer checklist.