Skip to content

[Due for payment 2026-11-18] [$175] "Please enter different email error" displayed when navigate back to Work email modal #101576

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.84-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/74548899/folder/57203762/41237586/1771052682?sort=%2Bstatus_id
Email or phone of affected tester (no customers): gocetest@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: windows 10/chrome
App Component: Other

Action Performed:

  1. Login with new public domain user
  2. Verify "What’s your work email?" modal is displayed
  3. Enter any user with private domain (sdfasdfasdf@test.com for example)
  4. Click Add work email button
  5. Verify confirmation magic code modal is displayed
  6. Navigate Back

Expected Result:

There should be no error message

Actual Result:

"Please enter a different email than the one you signed up with" error message is displayed
After several back and forward tries with different emails Add work email button become unresponsive

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7263050_1789721788145.Recording__1663.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Nathan Lemma
Bug ID: 7263050

Issue OwnerCurrent Issue Owner: @amyevans
Upwork Automation - Do Not Edit

Activity

  1. added
    DeployBlockerCash
    Bug
    on Sep 18, 2026
  2. applause-bot commented on Sep 18, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/c37b15005ebbd8605530f0c4106550f2599967cb401cefc3bb127cc97d77d212

  3. github-actions commented on Sep 18, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  4. melvin-bot commented on Sep 18, 2026

    @melvin-bot

    Triggered auto assignment to @amyevans (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Sep 18, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  6. MelvinBot commented on Sep 18, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Undetermined — no PR in the 9.4.84 checklist touches the affected code path (see Verification below). Keeping the existing DeployBlockerCash label until the trigger is confirmed.
    Causing PR: None identified in the 9.4.84-1 StagingDeployCash checklist (Low confidence for every candidate I evaluated)
    Related Issues: [$250] [Due for payment 2026-03-19] Onboarding work email: re-add public domain validation and prevent same-email submission — the issue that introduced the validation rule producing this exact copy

    Recommendation: NEEDS INVESTIGATION

    Every file in this flow (the onboarding work-email pages, the whole src/components/Form library, Session/Welcome actions, and the en strings) is byte-identical between production and staging, so there is no App PR in this release to revert. @amyevans — could we get the tester to re-confirm production and grab a requestID for the AddWorkEmail call, so we can tell whether the backend response is what changed?

    Labels: No changes. DeployBlockerCash kept (no causing App PR ruled in or out, and the issue is reported as not reproducible on production).

    📋 Detailed Analysis

    Evidence

    The reported copy has exactly one source in the codebase — the validate() callback on the onboarding work-email form:

    const validate = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM>) => {
    if (!shouldValidateOnChange) {
    setShouldValidateOnChange(true);
    }
    const userEmail = values[INPUT_IDS.ONBOARDING_WORK_EMAIL].trim();
    const errors = {};
    const emailParts = userEmail.split('@');
    const domain = emailParts.at(1) ?? '';
    if (session?.email && userEmail.toLowerCase() === session.email.toLowerCase() && !isOffline) {
    addErrorMessage(errors, INPUT_IDS.ONBOARDING_WORK_EMAIL, translate('onboarding.workEmailValidationError.sameAsSignupEmail'));
    } else if ((!Str.isValidEmail(userEmail) || PUBLIC_DOMAINS_SET.has(domain.toLowerCase())) && !isOffline) {
    Log.hmmm('User is trying to add an invalid work email', {userEmail, domain});
    addErrorMessage(errors, INPUT_IDS.ONBOARDING_WORK_EMAIL, translate('onboarding.workEmailValidationError.publicEmail'));
    }
    if (isOffline ?? false) {
    addErrorMessage(errors, INPUT_IDS.ONBOARDING_WORK_EMAIL, translate('onboarding.workEmailValidationError.offline'));
    }
    return errors;
    };

    if (session?.email && userEmail.toLowerCase() === session.email.toLowerCase() && !isOffline) {
        addErrorMessage(errors, INPUT_IDS.ONBOARDING_WORK_EMAIL, translate('onboarding.workEmailValidationError.sameAsSignupEmail'));
    }

    It is a purely local field error (it is never written to Onyx and the backend cannot set it), so for the tester to see it after typing sdfasdfasdf@test.com, session.email must have become the submitted work email by the time the user navigates back from the security-code screen. That points at the AddWorkEmail round trip mutating session.email rather than at the validation itself.

    That guard was added in Re-add public domain validation and prevent same-email submission on onboarding work email (merged 2026-03-11) and has been on production for six months, so it is not new in this release.

    The secondary symptom ("Add work email button becomes unresponsive") has a separate, plausible frontend cause: FormProvider returns early from submit whenever the Onyx form's isLoading is set, and AddWorkEmail sets isLoading: true optimistically with nothing resetting it if the user leaves the screen before the request settles.

    • FormProvider submit gate:
      const isExternalLoading = !!formState?.isLoading || isOnyxLoading;
      const {isLoading: isPressLoading, startWithLoading} = usePressLoading({isLoading: isExternalLoading});
      const isLoading = shouldShowLoadingImmediatelyOnPress ? isPressLoading : isExternalLoading;
      const submit = useDebounceNonReactive(
      useCallback(() => {
      // Return early if the form is already submitting to avoid duplicate submission
      if (isLoading) {
      return;
      }
    • AddWorkEmail optimistic isLoading:
      function AddWorkEmail(workEmail: string, formID: AddWorkEmailFormID = ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM) {
      const isOnboardingFlow = formID === ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM;
      const optimisticData: Array<OnyxUpdate<AddWorkEmailFormID | typeof ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY>> = isOnboardingFlow
      ? [
      {
      onyxMethod: Onyx.METHOD.MERGE,
      key: ONYXKEYS.FORMS.ONBOARDING_WORK_EMAIL_FORM,
      value: {
      onboardingWorkEmail: workEmail,
      isLoading: true,
      },
      },
      {
      onyxMethod: Onyx.METHOD.MERGE,
      key: ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY,
      value: null,
      },
      ]
      : [
      {
      onyxMethod: Onyx.METHOD.MERGE,
      key: ONYXKEYS.FORMS.ADD_WORK_EMAIL_FORM,
      value: {
      isLoading: true,
      errorFields: null,
      },
      },
    • Back-button handler that returns to this screen:
      function updateOnboardingValuesAndNavigation(onboardingValues: Onboarding | undefined) {
      Onyx.set(ONYXKEYS.NVP_ONBOARDING, {...onboardingValues, shouldValidate: undefined});
      // We need to have the Onyx values updated before navigating back
      // Because we navigate based no useEffect logic and we need to clear `shouldValidate` value before going back
      Navigation.setNavigationActionToMicrotaskQueue(() => {
      Navigation.goBack(ROUTES.ONBOARDING_WORK_EMAIL.getRoute());
      });
      }

    Verification

    I compared production (9.4.81-1) against staging (9.4.84-1) across the full 597-file diff, and separately checked blob SHAs via the GitHub contents/commits API (which is authoritative and not affected by a shallow clone):

    Path production staging
    src/pages/OnboardingWorkEmail/ (all 4 files) identical identical
    src/pages/OnboardingWorkEmailValidation/BaseOnboardingWorkEmailValidation.tsx 9842a669d (2026-08-08) 9842a669d
    src/components/Form/ (all 8 files) identical identical
    src/libs/actions/Session/index.ts a16bad68f (2026-09-11) a16bad68f
    src/libs/actions/Welcome/index.ts 752dc5672 (2026-07-06) 752dc5672
    src/languages/* onboarding.workEmailValidationError.* unchanged unchanged

    Nothing in the import graph of BaseOnboardingWorkEmail changed either — the only onboarding-adjacent files in the release diff are src/components/OnboardingHelpDropdownButton.tsx and src/hooks/useCompleteOnboarding.ts, neither of which is on this code path.

    Candidates I ruled out after reading their diffs (all touch shared infrastructure but none touch session email, form validation, or onboarding navigation):

    Root Cause

    Not established. Two hypotheses, in order of likelihood:

    1. Backend/data trigger. AddWorkEmail's response (or a Pusher update following it) now leaves session.email set to the submitted work email before the merge is validated. The frontend guard then fires correctly-but-uselessly on the way back. If confirmed, the frontend should still be hardened: compare against the signup login captured at sign-in rather than live session.email, and skip the check for an address that is merely pending validation.
    2. Pre-existing frontend bug that Applause reached for the first time via exploratory testing (bug source is listed as Exploratory), in which case "not reproducible in production" is unreliable — onboarding only runs once per account, so a production re-test needs a brand new public-domain signup.

    The stuck submit button is independently reproducible from code reading and should be fixed regardless, by clearing ONBOARDING_WORK_EMAIL_FORM.isLoading when the work-email screen regains focus.

  7. nlemma commented on Sep 18, 2026

    @nlemma

    This bug shows up on every PR, so it’s hard to pinpoint the PR that caused it.

  8. MelvinBot commented on Sep 18, 2026

    @MelvinBot
    Contributor

    🤖 Addendum to the investigation above — no App PR in this release can be reverted for this.

    Bottom line: every file in this flow (the onboarding work-email pages, the whole src/components/Form library, and the Session/Welcome actions) is byte-identical between production (9.4.81-1) and staging (9.4.84-1), so there is no causing PR in the 9.4.84 checklist. The full evidence — blob-SHA comparison per file, plus the candidate PRs I read and ruled out — is in the detailed comment.

    What I'd do next:

    1. Re-test on production with a brand new public-domain signup. Onboarding runs once per account, so the "not reproducible in production" signal is weak — and staging App points at the production API, so a pure backend change should break both.
    2. Grab a requestID for the AddWorkEmail call. The error copy is a purely local field error with one producer that compares the typed address to live session.email — so it can only fire on a different address if AddWorkEmail has already mutated session.email to the submitted work email.

    One fix worth making regardless of the trigger: the stuck "Add work email" button is independently explainable from code. AddWorkEmail sets isLoading: true optimistically (src/libs/actions/Session/index.ts:1659-1686) and FormProvider returns early from submit while it's set — with nothing clearing it if the user navigates back before the request settles. Clearing ONBOARDING_WORK_EMAIL_FORM.isLoading when that screen regains focus fixes the unresponsive button.

    I also tried to reproduce this on web to settle hypothesis 1, but the test session was unusable (the app client had gone blank before handoff), so that attempt produced no repro data either way.

    DeployBlockerCash left in place — I can't rule a PR in or out, so demoting it isn't mine to call. amyevans, over to you on the production re-test.


    Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.


    view run · no recording available

  9. amyevans commented on Sep 18, 2026

    @amyevans
    Contributor

    I've not been able to reproduce 🤔 . I've tried a couple times, here's one for instance:

    Screen.Recording.2026-09-18.at.9.37.50.AM.mov

    I'm investigating backend code/logs though to see if anything comes up

  10. amyevans commented on Sep 18, 2026

    @amyevans
    Contributor

    Alright turns out it's slightly different steps needed to reproduce:

    1. Sign up fresh with a gmail address. Do not validate it.
    2. Enter a work email nobody has ever used, on an uncontrolled domain.
    3. Confirm you landed on the private-domain screen (the magic code goes to the work email you just typed, not your gmail)
    4. Press back.

    With that I'm able to reproduce on production:

    Screen.Recording.2026-09-18.at.9.58.35.AM.mov

    So not a deploy blocker

  11. 92 remaining items

  12. added
    Awaiting Payment
    and removed
    Skip Payment
    on Nov 18, 2026
  13. changed the title [-][$175] "Please enter different email error" displayed when navigate back to Work email modal[/-] [+][Due for payment 2026-11-18] [$175] "Please enter different email error" displayed when navigate back to Work email modal[/+] on Nov 18, 2026
  14. expensify-chore-bot commented on Nov 18, 2026

    @expensify-chore-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  15. TaduJR commented on Nov 18, 2026

    @TaduJR
    Contributor
    • [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: Re-add public domain validation and prevent same-email submission on onboarding work email #84448 (comment)
      Link to the comment on the Issue:

    • [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: N/A. Not critical: it only happened after going back from the next step, and the user could still finish onboarding with Skip or a different email.

    • [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.

    Regression Test Proposal

    Precondition:

    • Sign up with a new public-domain email (for example a new Gmail address) and don't validate it.
    • Make up a work email on a company domain nobody uses (for example yourname+1@qa-test-4821.com).
    • "Press back" means the browser back button on web and the system back button on Android.

    Test:

    1. On "What’s your work email?", enter the made-up work email and tap "Add work email".
    2. Verify "See if your team's in Expensify" appears.
    3. Tap "Back" at the top of the screen.
    4. Verify "What’s your work email?" appears with the work email still in the field and no error.
    5. Tap "Add work email".
    6. Verify "Please enter a different email than the one you signed up with" doesn't appear and "See if your team's in Expensify" appears.
    7. Web and Android only: press back.
    8. Verify "What’s your work email?" appears with the work email filled in and no message.
    9. Web only: reload the page.
    10. Web and Android only: press back again.
    11. Verify "Please finish the setup questions to start using the app" appears.
    12. Tap "Add work email".
    13. Verify "See if your team's in Expensify" appears.
    14. Tap "Skip".
    15. Verify "What do you want to do today?" appears without "Please finish the setup questions to start using the app".

    Do we agree 👍 or 👎

  16. TaduJR commented on Nov 18, 2026

    @TaduJR
    Contributor

    Price increase request

    Mandatory

    Proposed amount: $350

    Why the work exceeded the issue: The issue asked to remove a wrong error after going back to "What’s your work email?". Fixing everything in the report took three PRs: the error itself, the "Add work email" button becoming unresponsive, and back on "See if your team's in Expensify", which did nothing and showed the "finish setup" message on the next screen.

    Regressions caused by this PR: None. The last PR's regression period ended on 2026-11-13.

    Optional

    Multiple PRs:

    Files touched: 18 across the three PRs (+931 −36): the onboarding work email and private-domain screens, the root navigator's handling of blocked browser back, and tests.

    Core flow changes: Onboarding (work email and private-domain steps) and browser back handling in the root navigator (#105493).

    Test coverage: 22 new UI and unit tests (3, 5 and 14). Tested on web in wide and narrow layouts for all three PRs, and on the Android app for #102843 and #105493.

    cc @amyevans

  17. expensify-chore-bot commented on Nov 18, 2026

    @expensify-chore-bot

    Payment Summary

    Resolving PRs:

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  18. mallenexpensify commented on Nov 19, 2026

    @mallenexpensify
    Contributor

    Claude posting on behalf of Matt:

    Your call. Job price: $250 (TaduJR assigned 2026-09-18).

    • TaduJR (C+): 100%, via Upwork

    TaduJR asked for $350. No employee has ruled. The strict rule gives 100%.

    The request says three PRs fixed the full report.

    MelvinBot wrote all three PRs. No deploy blockers.

    Next: pick the amount, press Caps+Y, then pay.

    Evidence
    • C+ checklist, 18 steps: comment
    • PRs: 102843, 103780, 105493, all approved by TaduJR and amyevans. Last production 2026-11-06.
    • Offending PR 84448: TaduJR did not write or approve it. Melvin found the cause.
    • Test videos: C+ 3/5, 3/5, 2/5. TestRail case: none.

    PAYPREP v1

  19. mallenexpensify commented on Nov 20, 2026

    @mallenexpensify
    Contributor

    @amyevans 👀 on the price increase request above plz.

  20. amyevans commented on Nov 20, 2026

    @amyevans
    Contributor

    @mallenexpensify 👍 to $350

  21. mallenexpensify commented on Nov 20, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @TaduJR paid $350 via Upwork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions