Repository navigation
Stop the onboarding back button message from blocking Add work email - #103780
Conversation
The back button message no longer goes into the work email form's errors, so it shows once and no longer blocks the submit. Pressing Add work email clears it, so a failed validation shows only the field error. Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to 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 these steps on Android. The test environment finished onboarding before the test started, so the one-time "What's your work email?" screen was already skipped. This is a test environment limit, not a defect in this PR. The PR's Tests section is still a TODO, so I used the steps from the linked issues and the PR description.
To test this flow, the run needs a session that stops at the work email screen instead of skipping it. |
|
🤖 Web test steps verification results: The work email screen loads, "Add work email" moves forward with a private-domain email, and going back shows no "different email" error. I couldn't run the two browser back steps, which are the core of this fix, because the web test tool can't press the browser back button. These two need a manual check.
|
|
Please merge main |
…orkEmail Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
I merged None of this PR's 3 files changed on |
|
@codex review |
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. |
|
The failing Analysis: Thread report drafts explicitly through the split-transaction update flow merged into Evidence:
Next step: Once a fix for that test lands on |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcfcc39e12
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!workEmailErrorTranslationKey) { | ||
| clearWorkEmailFormErrors(); | ||
| return; |
There was a problem hiding this comment.
Preserve blocking email errors when back is pressed
When AddWorkEmail has produced a blocking 2FA, SSO, or closed-account error and the user then triggers the protected device/browser back action, the global key changes from that error to errorBackButton. This makes workEmailErrorTranslationKey become undefined, so this branch clears the existing form error; the back message is non-blocking, and the same rejected email can immediately be submitted again without being edited. Previously the back action replaced the form error with another blocking error, so this newly permits retries and discards the actionable response; the back-message path should preserve any existing work-email error instead of clearing it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The resend is intended, and it doesn't lose anything that main keeps.
On main, the back press already replaces the 2FA, SSO or closed-account message, because they share one Onyx key, so the reason is gone from the screen there too. The block after it only lasts until an edit: typing a character and deleting it resends the same email.
With this PR, one press after back resends the email, the backend rejects it with the same error, and the field blocks again. That costs one extra request, and the user sees the reason again without editing.
Keeping the old error through a back press needs a separate key for the back message, which is a follow-up.
|
Nothing has changed since my last comment. The
Next step: The fix belongs on |
|
Please replace the PR description with the below one DescriptionExplanation of ChangeDuring onboarding, pressing back (the browser back button on web, the device back button on Android) or opening an Expensify link shows "Please finish the setup questions to start using the app". On the work email screen, that message was also added to the email field as an error. The user saw it twice, under the field and above Skip, along with "Please fix the errors in the form before continuing." The form doesn't submit while a field has an error, so "Add work email" did nothing until the user changed the email. Pressing back while the email was being sent also stopped the loading spinner early. With this change, the work email screen no longer treats that message as an email error:
Errors about the email itself, such as an account with two-factor authentication or single sign-on, still show on the field and still block "Add work email" until the email changes. Fixed Issues$ #101576 TestsTest 1: Back, then the same work email
Test 2: Back, then an invalid email
Test 3: "Back" on the next screen
Offline tests
QA StepsSame as Tests.
PR Author Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / Safari |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-10-13.at.3.27.03.PM.movAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariiOS-mWeb.mp4MacOS: Chrome / SafariMac-Chrome.mp4 |
|
🤖 I replaced the PR description with the text inside your "Description" block. I didn't change any wording, quote characters, or checkboxes. |
|
Please mark the PR as ready for review |
|
I marked this PR as ready for review. The |
|
Please merge main |
|
Merged One change from |
|
Please resolve conflicts. |
…ButtonMessageBlocksAddWorkEmail Co-authored-by: TaduJR <TaduJR@users.noreply.github.com> # Conflicts: # src/pages/OnboardingWorkEmail/BaseOnboardingWorkEmail.tsx # tests/ui/WorkEmailOnboarding.tsx
|
I fixed the merge conflicts by merging Both conflicts came from separate additions, so I kept both sides:
All 56 tests in |
|
ESLint check failed |
|
The failing Errors:
Next step: Merge Evidence
|
|
The [No QA] Remove useless Onyx.connect causing lint failures fixes it and is open now. After it merges, merge Why that PR is enoughThe CI step runs lint twice: once with the ESLint cache, then again with the cache cleared. The step fails only if the second run fails.
Other PRs opened today fail with the same pattern. |
|
@MelvinBot merge main |
|
I didn't merge GitHub reports no merge conflicts right now. I can only make code changes when directed by the PR author, an assignee, or an existing co-author. To have me implement this, the PR assignee or author should reply with a request tagging me. |
|
@MelvinBot please merge main |
…ButtonMessageBlocksAddWorkEmail Co-authored-by: TaduJR <TaduJR@users.noreply.github.com>
|
I merged the latest |
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
|
🚧 amyevans has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/amyevans in version: 9.5.10-0 🚀
|
|
No help site update is needed. This bug fix stops the onboarding back button message from blocking Add work email, and no help article describes that message or behavior. |
|
🚀 Deployed to staging by https://github.com/amyevans in version: 9.5.12-0 🚀
|
|
No help site update is needed. This bug fix makes Add work email work the way users already expect, and no article mentions the back button message or describes the old behavior. What I checkedTroubleshoot adding your work email during account setup lists the messages that appear under the work email field. The 2FA, SSO/SAML, and closed account messages still appear there after this change, so that list is still correct. |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.12-1 🚀
Bundle Size Analysis (Sentry): |




Explanation of Change
During onboarding, pressing back (the browser back button on web, the device back button on Android) or opening an Expensify link shows "Please finish the setup questions to start using the app".
On the work email screen, that message was also added to the email field as an error. The user saw it twice, under the field and above Skip, along with "Please fix the errors in the form before continuing." The form doesn't submit while a field has an error, so "Add work email" did nothing until the user changed the email. Pressing back while the email was being sent also stopped the loading spinner early.
With this change, the work email screen no longer treats that message as an email error:
Errors about the email itself, such as an account with two-factor authentication or single sign-on, still show on the field and still block "Add work email" until the email changes.
Fixed Issues
$ #101576
$ #102916
PROPOSAL: #101576 (comment)
Tests
Test 1: Back, then the same work email
Test 2: Back, then an invalid email
not-an-email.Test 3: "Back" on the next screen
Offline tests
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari