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
[$175] Onboarding - Explain how to merge when "We couldn't add [work email]" blocks the user #105015
Some users sign up with a phone number or a personal email. In onboarding, they then enter a work email that already has an Expensify account. They see the generic "We couldn't add [email]" screen, which doesn't say why it failed or how to fix it.
This is the fallback subtitle, onboarding.mergeBlockScreen.subtitle, in src/components/OnboardingMergingAccountBlockedView.tsx. Other merge-account error paths already tell the user the reason and the next step (Figma). This case seems to have been missed.
Solution
When the work email belongs to an existing account, show: "Sign in with [work email] and merge this account from Account > Security > Merge accounts."
changed the title [-]Onboarding - Explain how to merge when "We couldn't add [work email]" blocks the user[/-][+][$175] Onboarding - Explain how to merge when "We couldn't add [work email]" blocks the user[/+]on Oct 26, 2026
Please re-state the problem that we are trying to solve in this issue.
A user who signed up with a phone number or a personal email enters, during onboarding, a work email that already belongs to another Expensify account. The "Couldn’t add work email" screen shows only the generic fallback subtitle (onboarding.mergeBlockScreen.subtitle, "We couldn’t add [email]. Please try again later..."), so the user doesn't learn why it failed or how to merge. We want this case to show: "Sign in with [work email] and merge this account from Account > Security > Merge accounts.", in every supported locale.
What is the root cause of that problem?
OnboardingMergingAccountBlockedView picks its subtitle from ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY and only falls back to the generic subtitle when that key is empty:
The key is set in the .then() of AddWorkEmail in src/libs/actions/Session/index.ts. When the user's current account is already validated (they signed in with their phone or personal email and a magic code) and the work email belongs to an existing account, the backend refuses to merge (takeover protection) and returns jsonCode: 666 with message: "403 Forbidden". That is CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR ("Returned when an already validated public-domain account tries to add a work email"). The client only turns it into specific copy when the request comes from the Concierge "Add work email" task:
// When the work email is a domain-controlled login for an existing account, surface a specific subtitle in the blocking screen instead of the generic one.
In the regular onboarding work-email step, BaseOnboardingWorkEmail calls AddWorkEmail(submittedWorkEmail, addWorkEmailTaskReport) with no task report, so addWorkEmailTaskReport is undefined. The 403 then only sets isMergingAccountBlocked: true, and the view shows the generic fallback. The existing unit test documents this behaviour: tests/unit/AddWorkEmailTest.ts > "blocks the merge on a generic failure" sends exactly this 403 Forbidden response.
A second, smaller path reaches the same fallback: when the user does get the magic code but MergeIntoAccountAndLogin fails for any reason other than an invalid code, it sets isMergingAccountBlocked: true without an error key (Session/index.ts L1858-L1864). At that point the work email is known to belong to an existing account, because the merge step only runs after shouldValidate.
What changes do you think we should make in order to solve the problem?
New translation key. Add onboarding.mergeBlockScreen.existingAccountSubtitle next to the other mergeBlockScreen subtitles in src/languages/en.ts, with the same (workEmail: string | undefined) signature as domainControlledSubtitle:
existingAccountSubtitle: (workEmail: string|undefined)=>`Sign in with ${workEmail} and merge this account from Account > Security > Merge accounts.`,
Add it to every locale in src/languages/ (de, el, es, fr, it, ja, nl, pl, pt-BR, zh-hans), reusing each locale's existing "Account > Security > Merge accounts" path from validatedPublicDomainSubtitle so the menu names match the app, for example:
es: Inicia sesión con ${workEmail} y fusiona esta cuenta desde Cuenta > Seguridad > Fusionar cuentas.
fr: Connectez-vous avec ${workEmail} et fusionnez ce compte depuis Compte > Sécurité > Fusionner les comptes.
de: Melden Sie sich mit ${workEmail} an und führen Sie dieses Konto unter Konto > Sicherheit > Konten zusammenführen zusammen.
The rest (el, it, nl, pl, pt-BR, zh-hans) follow the same pattern, or come from scripts/generateTranslations.ts and the Polyglot Parrot diff, reviewed by hand.
Set the key for the existing-account rejection in every onboarding flow (AddWorkEmail, src/libs/actions/Session/index.ts). Drop the addWorkEmailTaskReport && gate, so the standard onboarding step and the Concierge task show the same copy:
The check stays where it is now, below the !isOnboardingFlow early return, and is not added to the errorTranslationKey chain. On the workspace company-card / Expensify Card forms ([Due for payment 2026-09-22] Add your work email page gets stuck in infinite loading when backend returns an error #98664), the same 403 must keep showing common.genericErrorMessage inline, not onboarding merge instructions. The new key replaces validatedPublicDomainSubtitle, which said the same thing in older wording. I'd remove that key and its three references, so we don't keep two strings for one case.
Merge step failures (MergeIntoAccountAndLogin, same file). In the else branch that blocks the merge, also write ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY = 'onboarding.mergeBlockScreen.existingAccountSubtitle'. If the message contains CONST.MERGE_ACCOUNT_2FA_ERROR or CONST.MERGE_ACCOUNT_SINGLE_SIGN_ON_ERROR, use the existing onboarding.workEmail2FAError / onboarding.singleSignOnError keys instead, the same mapping AddWorkEmail already uses. Signing in to the work account and merging from Security is the right recovery for any failure at this point.
Let the view and the purpose screen pass the email to the new key. In OnboardingMergingAccountBlockedView.getErrorSubtitle and BaseOnboardingPurpose.getErrorMessage, the email-interpolated keys are compared one by one. Add existingAccountSubtitle to that branch, using a small shared list (for example MERGE_BLOCK_SUBTITLE_KEYS_WITH_EMAIL in CONST or the Welcome actions) instead of growing the === chain in two places:
The generic onboarding.mergeBlockScreen.subtitle stays as the fallback for unknown backend errors.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/unit/AddWorkEmailTest.ts, onboarding: a 403 Forbidden response with no task report sets isMergingAccountBlocked: trueandONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY = 'onboarding.mergeBlockScreen.existingAccountSubtitle'.
Same file: an unknown error (for example 500) still sets only isMergingAccountBlocked, so the generic subtitle remains the fallback.
Same file, workspace card flow: the 403 still shows common.genericErrorMessage inline and writes no onboarding state (the existing test keeps passing).
MergeIntoAccountAndLogin: a non-invalid-code error sets the new key; an invalid code still sets contacts.genericFailureMessages.validateSecondaryLogin and does not block.
OnboardingMergingAccountBlockedView: with the new key in Onyx, the subtitle renders the translated copy with the work email.
What alternative solutions did you explore? (Optional)
Keep validatedPublicDomainSubtitle for the Concierge task flow and add the new key only for standard onboarding. This changes less copy, but leaves two near-identical messages for the same backend error.
Change the generic fallback copy to the merge instructions. That's simpler, but the fallback also covers failures where the work email isn't an existing account (unknown backend errors), and the instructions would be wrong there.
Have the backend return a dedicated error string (like 401 work domain is controlled) for the takeover-protection case instead of a bare 403 Forbidden. That's cleaner long-term, but it needs an internal change. The frontend change above works with the current response, and the constant can be swapped later.
Please re-state the problem that we are trying to solve in this issue.
When a user signs up with a phone number or a personal email and then enters a work email that already belongs to an existing Expensify account during onboarding, the blocking screen (OnboardingMergingAccountBlockedView) displays the generic fallback message (onboarding.mergeBlockScreen.subtitle: "We couldn’t add [work email]. Please try again later in Settings or chat with Concierge for guidance."). Unlike the other merge-block paths, this message does not explain why adding the email failed or how the user can merge their accounts.
What is the root cause of that problem?
In src/components/OnboardingMergingAccountBlockedView.tsx, getErrorSubtitle() checks ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY for specific merge-block reasons (validatedPublicDomainSubtitle, domainControlledSubtitle, workAccountClosedSubtitle) and otherwise falls back to translate('onboarding.mergeBlockScreen.subtitle', workEmail):
constgetErrorSubtitle=()=>{if(onboardingErrorMessage==='onboarding.mergeBlockScreen.validatedPublicDomainSubtitle'){returntranslate(onboardingErrorMessage,workEmail);}// This subtitle interpolates the work email, so translate it with the email explicitly.if(onboardingErrorMessage==='onboarding.mergeBlockScreen.domainControlledSubtitle'){returntranslate('onboarding.mergeBlockScreen.domainControlledSubtitle',workEmail);}if(onboardingErrorMessage){returntranslate(onboardingErrorMessage);}// Fallback to generic error messagereturntranslate('onboarding.mergeBlockScreen.subtitle',workEmail);};
There are two onboarding flows where an existing work account triggers isMergingAccountBlocked: true while leaving ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY unset (null), hitting onboarding.mergeBlockScreen.subtitle:
Validated personal-email / phone-number login in standard onboarding (AddWorkEmail in src/libs/actions/Session/index.ts):
When the current account is already validated and tries to add an existing work email, the backend rejects the merge with CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR ('403 Forbidden'). Because Session/index.ts gates validatedPublicDomainSubtitle behind if (addWorkEmailTaskReport && response?.message === CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR), standard onboarding (where addWorkEmailTaskReport is undefined) only sets Onyx.merge(ONYXKEYS.NVP_ONBOARDING, {isMergingAccountBlocked: true}) with no error translation key.
Account merge blocked during MergeIntoAccountAndLogin (src/libs/actions/Session/index.ts and tests/ui/WorkEmailOnboarding.tsx):
When an unvalidated user enters a work email belonging to an existing account (shouldValidate: true) and submits the validation code to MergeIntoAccountAndLogin, the backend blocks non-mergeable accounts either by returning isMergingAccountBlocked: true in onyxData (e.g., jsonCode: 501 in MergeIntoAccountAndLoginBlockMerge at tests/ui/WorkEmailOnboarding.tsx#L150-L166) or via the else branch of response?.jsonCode === CONST.JSON_CODE.EXP_ERROR (666). In both cases, ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY was cleared to null in optimisticData, so OnboardingMergingAccountBlockedView renders onboarding.mergeBlockScreen.subtitle.
Because onboarding.mergeBlockScreen.subtitle in src/languages/*.ts still holds the legacy copy ("We couldn’t add ${workEmail}. Please try again later in Settings or chat with Concierge for guidance."), the user is not told to sign in with their work email and merge from Account > Security > Merge accounts.
What changes do you think we should make in order to solve the problem?
Update onboarding.mergeBlockScreen.subtitle across all 11 supported locale files (src/languages/en.ts, de.ts, el.ts, es.ts, fr.ts, it.ts, ja.ts, nl.ts, pl.ts, pt-BR.ts, zh-hans.ts), preserving the (workEmail: string | undefined) => string function signature and using each locale's exact navigation path for Account > Security > Merge accounts:
src/languages/en.ts
subtitle: (workEmail: string|undefined)=>`Sign in with ${workEmail} and merge this account from Account > Security > Merge accounts.`,
src/languages/de.ts
subtitle: (workEmail: string|undefined)=>`Melden Sie sich mit ${workEmail} an und führen Sie dieses Konto unter Konto > Sicherheit > Konten zusammenführen zusammen.`,
src/languages/el.ts
subtitle: (workEmail: string|undefined)=>`Συνδεθείτε με το ${workEmail} και συγχωνεύστε αυτόν τον λογαριασμό από Λογαριασμός > Ασφάλεια > Συγχώνευση λογαριασμών.`,
src/languages/es.ts
subtitle: (workEmail: string|undefined)=>`Inicia sesión con ${workEmail} y fusiona esta cuenta desde Cuenta > Seguridad > Fusionar cuentas.`,
src/languages/fr.ts
subtitle: (workEmail: string|undefined)=>`Connectez-vous avec ${workEmail} et fusionnez ce compte depuis Compte > Sécurité > Fusionner les comptes.`,
src/languages/it.ts
subtitle: (workEmail: string|undefined)=>`Accedi con ${workEmail} e unisci questo account da Account > Sicurezza > Unisci account.`,
Existing test 'should display onboarding merge block screen content correctly' in tests/ui/WorkEmailOnboarding.tsx (L1287-L1314) already asserts expect(screen.getByText(TestHelper.translateLocal('onboarding.mergeBlockScreen.subtitle', workEmail))).toBeOnTheScreen() after MergeIntoAccountAndLoginBlockMerge().
Add an explicit test verifying that when AddWorkEmail is rejected with 403 Forbidden during standard onboarding (without a Concierge task report), OnboardingMergingAccountBlockedView renders the updated onboarding.mergeBlockScreen.subtitle interpolated with workEmail.
What alternative solutions did you explore? (Optional)
We also evaluated keeping onboarding.mergeBlockScreen.subtitle for unknown AddWorkEmail666 failures and introducing a dedicated key (onboarding.mergeBlockScreen.existingAccountSubtitle) set when the work email belongs to an existing account.
Updating onboarding.mergeBlockScreen.subtitle directly matches the issue specification verbatim ("This is the fallback subtitle, onboarding.mergeBlockScreen.subtitle, in src/components/OnboardingMergingAccountBlockedView.tsx... Solution: When the work email belongs to an existing account, show: 'Sign in with [work email] and merge this account from Account > Security > Merge accounts.' Update all supported locales"), covers both AddWorkEmail (403 Forbidden) and MergeIntoAccountAndLogin (501 via onyxData and 666), and avoids writing an email-parameterized key to ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY.
If we instead want unknown AddWorkEmail666 errors (e.g., 500) to retain the generic fallback while existing-account blocks show the merge instructions via onboarding.mergeBlockScreen.existingAccountSubtitle, three things must be handled together so no path breaks:
In AddWorkEmail (src/libs/actions/Session/index.ts#L1790), set ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY to 'onboarding.mergeBlockScreen.existingAccountSubtitle' whenever response?.message === CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR (removing the addWorkEmailTaskReport && gate).
In MergeIntoAccountAndLogin (src/libs/actions/Session/index.ts#L1858-L1873), set 'onboarding.mergeBlockScreen.existingAccountSubtitle' both in the response?.jsonCode === CONST.JSON_CODE.EXP_ERROR (666) non-invalid-code branch and when onboardingUpdate?.value sets isMergingAccountBlocked: true (such as jsonCode: 501 in MergeIntoAccountAndLoginBlockMerge at tests/ui/WorkEmailOnboarding.tsx#L150-L166, which bypasses the jsonCode === 666 branch).
In src/pages/OnboardingWorkEmail/BaseOnboardingWorkEmail.tsx#L282-L291, pass workEmail (or skip mergeBlockScreen keys) when calling addWorkEmailFormError(translate(workEmailErrorTranslationKey, workEmail)), because calling translate(workEmailErrorTranslationKey) without workEmail interpolates "undefined" into the form error state.
Please re-state the problem that we are trying to solve in this issue.
When a user enters a work email during onboarding that belongs to an existing Expensify account, the blocking screen displays a generic error message ("We couldn’t add [work email]. Please try again later in Settings or chat with Concierge for guidance.") instead of explaining how to sign in with the work email and merge the accounts.
What is the root cause of that problem?
In src/libs/actions/Session/index.ts (lines 1790–1792):
ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY is only set to 'onboarding.mergeBlockScreen.validatedPublicDomainSubtitle' when addWorkEmailTaskReport is defined (i.e. task-based Concierge flow). In standard onboarding, addWorkEmailTaskReport is undefined.
As a result, standard onboarding sets isMergingAccountBlocked: true without setting ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY.
In src/components/OnboardingMergingAccountBlockedView.tsx (lines 48–49), getErrorSubtitle falls back to onboarding.mergeBlockScreen.subtitle:
// Fallback to generic error messagereturntranslate('onboarding.mergeBlockScreen.subtitle',workEmail);
Additionally, validatedPublicDomainSubtitle in src/languages/en.ts still contains the older phrasing rather than the requested concise copy: Sign in with [work email] and merge this account from Account > Security > Merge accounts.
What changes do you think we should make in order to solve the problem?
In src/libs/actions/Session/index.ts:
Remove the addWorkEmailTaskReport && condition so that any CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR during onboarding sets 'onboarding.mergeBlockScreen.validatedPublicDomainSubtitle':
- if (addWorkEmailTaskReport && response?.message === CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR) {+ if (response?.message === CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR) {
Onyx.merge(ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY, 'onboarding.mergeBlockScreen.validatedPublicDomainSubtitle');
}
Update validatedPublicDomainSubtitle across all 11 supported locales in src/languages/*.ts:
en.ts: (workEmail) => \Sign in with ${workEmail} and merge this account from Account > Security > Merge accounts.``
es.ts: (workEmail) => \Inicia sesión con ${workEmail} y fusiona esta cuenta desde Cuenta > Seguridad > Fusionar cuentas.``
de.ts: (workEmail) => \Melden Sie sich mit ${workEmail} an und führen Sie dieses Konto unter Konto > Sicherheit > Konten zusammenführen zusammen.``
fr.ts: (workEmail) => \Connectez-vous avec ${workEmail} et fusionnez ce compte depuis Compte > Sécurité > Fusionner les comptes.``
it.ts: (workEmail) => \Accedi con ${workEmail} e unisci questo account da Account > Sicurezza > Unisci account.``
nl.ts: (workEmail) => \Meld je aan met ${workEmail} en voeg dit account samen via Account > Beveiliging > Accounts samenvoegen.``
pl.ts: (workEmail) => \Zaloguj się jako ${workEmail} i scal to konto w Konto > Zabezpieczenia > Scal konta.``
pt-BR.ts: (workEmail) => \Faça login com ${workEmail} e mescle esta conta em Conta > Segurança > Mesclar contas.``
el.ts: (workEmail) => \Συνδεθείτε με το ${workEmail} και συγχωνεύστε αυτόν τον λογαριασμό από Λογαριασμός > Ασφάλεια > Συγχώνευση λογαριασμών.``
What alternative solutions did you explore? (Optional)
Changing onboarding.mergeBlockScreen.subtitle fallback directly instead of validatedPublicDomainSubtitle:
Rejected because subtitle is used as the generic fallback for unspecified errors, while validatedPublicDomainSubtitle specifically handles existing validated public domain accounts. Removing the addWorkEmailTaskReport guard correctly categorizes existing account errors across all onboarding entry points.
Please re-state the problem that we are trying to solve in this issue.
A user signs up with a personal email or phone number, then enters a work email that already belongs to another Expensify account during onboarding. The merge-blocked screen shows only the generic fallback "We couldn't add [work email]", with no reason for the failure and no next step for the user.
What is the root cause of that problem?
OnboardingMergingAccountBlockedView dispatches on ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY: validatedPublicDomainSubtitle and domainControlledSubtitle each get a specific subtitle, but the existing-account failure sets no specific key, so getErrorSubtitle falls through to the generic onboarding.mergeBlockScreen.subtitle. The component already receives workEmail; it simply has no existing-account branch to use it with.
What changes are you going to make to fix the problem?
Add a new locale string, for example onboarding.mergeBlockScreen.existingAccountSubtitle: "Sign in with [work email] and merge this account from Account > Security > Merge accounts." (wording per the issue).
Set ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY to that key at the point where the work-email add fails specifically because the email belongs to an existing account, alongside the existing keys.
Add the branch in getErrorSubtitle in OnboardingMergingAccountBlockedView.tsx, passing workEmail, so the specific message renders only for this failure.
Add the string to all supported locale files, keeping the generic subtitle as the fallback for every other failure, so no other error path is mislabelled.
What will you verify?
Repro: sign up with a personal email, enter an existing work email in onboarding, and confirm the blocked screen now shows the sign-in-and-merge instruction with the work email interpolated. Confirm other merge-block reasons still show their own (or the generic) subtitle, and that the confirm-button flow back to the onboarding purpose/employees step is unchanged.
Please re-state the problem that we are trying to solve in this issue.
During onboarding, when a user signs up with a personal email or phone number and attempts to add a work email that already belongs to another existing Expensify account, the blocking screen (OnboardingMergingAccountBlockedView) displays an unhelpful generic error message ("We couldn't add [work email]...") instead of explaining that they should sign in with the work email and merge from Account > Security > Merge accounts.
What is the root cause of that problem?
In src/libs/actions/Session/index.ts (lines 1786–1794):
When attempting to add an existing work email during onboarding, specific error keys are only set for WORK_DOMAIN_CONTROLLED_ERROR and WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR. When the error is due to the work email already belonging to another account (e.g. ALREADY_EXISTS / standard merge conflict), no specific translation key is merged into ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY.
As a result, OnboardingMergingAccountBlockedView.tsx (getErrorSubtitle, lines 48-50) falls through to the generic fallback subtitle: translate('onboarding.mergeBlockScreen.subtitle', workEmail)
which does not inform the user why it failed or how to merge.
What changes do you think we should make in order to solve the problem?
Add new localized translation keys:
In src/languages/en.ts (and src/languages/es.ts):
onboarding: {mergeBlockScreen: {
...
existingAccountSubtitle: 'Sign in with {0} and merge this account from Account > Security > Merge accounts.',},},
Set the specific translation key on merge conflict:
In src/libs/actions/Session/index.ts inside the error handler for adding work email:
Identify when the backend returns the error indicating the email already exists on another account, and merge the new translation key:
Handle interpolation in the blocked view:
In src/components/OnboardingMergingAccountBlockedView.tsx, inside getErrorSubtitle:
Ensure the new key interpolates workEmail:
What alternative solutions did you explore? (Optional)
Changing the generic fallback string directly; however, that fallback is also used for other unexpected network/server errors during merge, so introducing an explicit dedicated translation key preserves distinct messaging for genuine server errors versus existing-account merge guidance.
Test Result / Verification:
Sign up for a new account using a phone number or personal email.
In the onboarding flow, proceed to the step prompting to add a work email.
Enter an email address that already belongs to an existing Expensify account.
Verify the blocked view title and subtitle clearly state: "Sign in with [work email] and merge this account from Account > Security > Merge accounts."
Verify the email placeholder {0} correctly displays the entered work email.
Switch application language to Spanish and confirm the localized subtitle renders correctly.
Please re-state the problem that we are trying to solve in this issue.
During onboarding, when a user who signed up with a phone number or personal email attempts to add a work email that already belongs to an existing Expensify account, the blocked screen (OnboardingMergingAccountBlockedView) displays an uninformative generic fallback subtitle ("We couldn't add [email]. Please try again later in Settings or chat with Concierge for guidance.") instead of guiding the user to sign in with their work email and merge accounts from Account > Security > Merge accounts.
What is the root cause of that problem?
In src/libs/actions/Session/index.ts (AddWorkEmail, lines 1785–1794), specific translation keys for ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY are only merged when response?.message equals CONST.WORK_DOMAIN_CONTROLLED_ERROR or CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR. When the work email belongs to an existing account (or causes a merge conflict rejection without matching those two strings), errorTranslationKey is undefined, and ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY is not updated before setting isMergingAccountBlocked: true.
In src/components/OnboardingMergingAccountBlockedView.tsx (getErrorSubtitle, lines 37–50), because onboardingErrorMessage is unset/undefined, the component falls through to the generic fallback on line 49: return translate('onboarding.mergeBlockScreen.subtitle', workEmail);
which displays the generic "We couldn't add [work email]" message without explanation or next steps.
What changes do you think we should make in order to solve the problem?
Locale updates:
In src/languages/en.ts and src/languages/es.ts under onboarding.mergeBlockScreen, add existingAccountSubtitle:
EN: (workEmail: string | undefined) => \Sign in with ${workEmail} and merge this account from Account > Security > Merge accounts.``
ES: (workEmail: string | undefined) => \Inicia sesión con ${workEmail} y fusiona esta cuenta desde Cuenta > Seguridad > Fusionar cuentas.`*(Note: Alternatively,validatedPublicDomainSubtitle` already contains this exact string and can be reused as the standard merge-account instruction).*
Session action update:
In src/libs/actions/Session/index.ts (AddWorkEmail error handling, lines 1785–1794):
When response?.jsonCode === CONST.JSON_CODE.EXP_ERROR during onboarding and the response indicates the email belongs to an existing account (or as the default blocking subtitle when adding an existing work email), set ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY to 'onboarding.mergeBlockScreen.existingAccountSubtitle' (or 'onboarding.mergeBlockScreen.validatedPublicDomainSubtitle').
Blocked view subtitle interpolation:
In src/components/OnboardingMergingAccountBlockedView.tsx (getErrorSubtitle, lines 37–44):
Handle existingAccountSubtitle alongside validatedPublicDomainSubtitle and domainControlledSubtitle to interpolate workEmail via translate(onboardingErrorMessage, workEmail).
What alternative solutions did you explore? (Optional)
Directly updating the generic fallback string onboarding.mergeBlockScreen.subtitle: Rejected because that fallback is also triggered on unexpected network or server failures where advising the user to sign in with that email would be inaccurate. Using an explicit key ensures targeted guidance for existing account conflicts while preserving generic messaging for true unexpected errors.
Verification / Tests
Sign up with a personal email or phone number.
In the onboarding flow, proceed to the step prompting to add a work email.
Enter a work email that already has an Expensify account.
Verify the blocked view renders: "Sign in with [work email] and merge this account from Account > Security > Merge accounts." with the entered email correctly interpolated.
Verify the Spanish translation displays accurately when the app language is switched to Spanish.
Verify unit tests in tests/unit/AddWorkEmailTest.ts pass and add a test case verifying ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY is set on existing account merge rejection.
Onboarding error guidance and Got it navigationBlocked before onboarding after one retry. The 403/501/666 guidance, security-specific errors, generic fallback, and confirmation navigation remain unverified in-browser.
Activity
melvin-bot commentedon Oct 26, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dmkt9 (
External)[-]Onboarding - Explain how to merge when "We couldn't add [work email]" blocks the user[/-][+][$175] Onboarding - Explain how to merge when "We couldn't add [work email]" blocks the user[/+]melvin-bot commentedon Oct 26, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022114731663671120637
camesenin commentedon Oct 26, 2026
melvin-bot commentedon Oct 26, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
xomaxie commentedon Oct 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A user who signed up with a phone number or a personal email enters, during onboarding, a work email that already belongs to another Expensify account. The "Couldn’t add work email" screen shows only the generic fallback subtitle (
onboarding.mergeBlockScreen.subtitle, "We couldn’t add [email]. Please try again later..."), so the user doesn't learn why it failed or how to merge. We want this case to show: "Sign in with [work email] and merge this account from Account > Security > Merge accounts.", in every supported locale.What is the root cause of that problem?
OnboardingMergingAccountBlockedViewpicks its subtitle fromONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYand only falls back to the generic subtitle when that key is empty:App/src/components/OnboardingMergingAccountBlockedView.tsx
Lines 37 to 50 in e91966a
The key is set in the
.then()ofAddWorkEmailinsrc/libs/actions/Session/index.ts. When the user's current account is already validated (they signed in with their phone or personal email and a magic code) and the work email belongs to an existing account, the backend refuses to merge (takeover protection) and returnsjsonCode: 666withmessage: "403 Forbidden". That isCONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR("Returned when an already validated public-domain account tries to add a work email"). The client only turns it into specific copy when the request comes from the Concierge "Add work email" task:App/src/libs/actions/Session/index.ts
Lines 1786 to 1793 in e91966a
In the regular onboarding work-email step,
BaseOnboardingWorkEmailcallsAddWorkEmail(submittedWorkEmail, addWorkEmailTaskReport)with no task report, soaddWorkEmailTaskReportisundefined. The 403 then only setsisMergingAccountBlocked: true, and the view shows the generic fallback. The existing unit test documents this behaviour:tests/unit/AddWorkEmailTest.ts> "blocks the merge on a generic failure" sends exactly this403 Forbiddenresponse.A second, smaller path reaches the same fallback: when the user does get the magic code but
MergeIntoAccountAndLoginfails for any reason other than an invalid code, it setsisMergingAccountBlocked: truewithout an error key (Session/index.tsL1858-L1864). At that point the work email is known to belong to an existing account, because the merge step only runs aftershouldValidate.What changes do you think we should make in order to solve the problem?
New translation key. Add
onboarding.mergeBlockScreen.existingAccountSubtitlenext to the othermergeBlockScreensubtitles insrc/languages/en.ts, with the same(workEmail: string | undefined)signature asdomainControlledSubtitle:Add it to every locale in
src/languages/(de, el, es, fr, it, ja, nl, pl, pt-BR, zh-hans), reusing each locale's existing "Account > Security > Merge accounts" path fromvalidatedPublicDomainSubtitleso the menu names match the app, for example:Inicia sesión con ${workEmail} y fusiona esta cuenta desde Cuenta > Seguridad > Fusionar cuentas.Connectez-vous avec ${workEmail} et fusionnez ce compte depuis Compte > Sécurité > Fusionner les comptes.Melden Sie sich mit ${workEmail} an und führen Sie dieses Konto unter Konto > Sicherheit > Konten zusammenführen zusammen.${workEmail} でサインインし、「アカウント」>「セキュリティ」>「アカウントの統合」からこのアカウントを統合してください。The rest (el, it, nl, pl, pt-BR, zh-hans) follow the same pattern, or come from
scripts/generateTranslations.tsand the Polyglot Parrot diff, reviewed by hand.Set the key for the existing-account rejection in every onboarding flow (
AddWorkEmail,src/libs/actions/Session/index.ts). Drop theaddWorkEmailTaskReport &&gate, so the standard onboarding step and the Concierge task show the same copy:The check stays where it is now, below the
!isOnboardingFlowearly return, and is not added to theerrorTranslationKeychain. On the workspace company-card / Expensify Card forms ([Due for payment 2026-09-22] Add your work email page gets stuck in infinite loading when backend returns an error #98664), the same 403 must keep showingcommon.genericErrorMessageinline, not onboarding merge instructions. The new key replacesvalidatedPublicDomainSubtitle, which said the same thing in older wording. I'd remove that key and its three references, so we don't keep two strings for one case.Merge step failures (
MergeIntoAccountAndLogin, same file). In theelsebranch that blocks the merge, also writeONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY = 'onboarding.mergeBlockScreen.existingAccountSubtitle'. If the message containsCONST.MERGE_ACCOUNT_2FA_ERRORorCONST.MERGE_ACCOUNT_SINGLE_SIGN_ON_ERROR, use the existingonboarding.workEmail2FAError/onboarding.singleSignOnErrorkeys instead, the same mappingAddWorkEmailalready uses. Signing in to the work account and merging from Security is the right recovery for any failure at this point.Let the view and the purpose screen pass the email to the new key. In
OnboardingMergingAccountBlockedView.getErrorSubtitleandBaseOnboardingPurpose.getErrorMessage, the email-interpolated keys are compared one by one. AddexistingAccountSubtitleto that branch, using a small shared list (for exampleMERGE_BLOCK_SUBTITLE_KEYS_WITH_EMAILinCONSTor the Welcome actions) instead of growing the===chain in two places:The generic
onboarding.mergeBlockScreen.subtitlestays as the fallback for unknown backend errors.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/unit/AddWorkEmailTest.ts, onboarding: a403 Forbiddenresponse with no task report setsisMergingAccountBlocked: trueandONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY = 'onboarding.mergeBlockScreen.existingAccountSubtitle'.500) still sets onlyisMergingAccountBlocked, so the generic subtitle remains the fallback.common.genericErrorMessageinline and writes no onboarding state (the existing test keeps passing).MergeIntoAccountAndLogin: a non-invalid-code error sets the new key; an invalid code still setscontacts.genericFailureMessages.validateSecondaryLoginand does not block.OnboardingMergingAccountBlockedView: with the new key in Onyx, the subtitle renders the translated copy with the work email.What alternative solutions did you explore? (Optional)
validatedPublicDomainSubtitlefor the Concierge task flow and add the new key only for standard onboarding. This changes less copy, but leaves two near-identical messages for the same backend error.401 work domain is controlled) for the takeover-protection case instead of a bare403 Forbidden. That's cleaner long-term, but it needs an internal change. The frontend change above works with the current response, and the constant can be swapped later.shilo1979jk commentedon Oct 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user signs up with a phone number or a personal email and then enters a work email that already belongs to an existing Expensify account during onboarding, the blocking screen (
OnboardingMergingAccountBlockedView) displays the generic fallback message (onboarding.mergeBlockScreen.subtitle:"We couldn’t add [work email]. Please try again later in Settings or chat with Concierge for guidance."). Unlike the other merge-block paths, this message does not explain why adding the email failed or how the user can merge their accounts.What is the root cause of that problem?
In
src/components/OnboardingMergingAccountBlockedView.tsx,getErrorSubtitle()checksONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYfor specific merge-block reasons (validatedPublicDomainSubtitle,domainControlledSubtitle,workAccountClosedSubtitle) and otherwise falls back totranslate('onboarding.mergeBlockScreen.subtitle', workEmail):There are two onboarding flows where an existing work account triggers
isMergingAccountBlocked: truewhile leavingONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYunset (null), hittingonboarding.mergeBlockScreen.subtitle:AddWorkEmailinsrc/libs/actions/Session/index.ts):When the current account is already validated and tries to add an existing work email, the backend rejects the merge with
CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR('403 Forbidden'). BecauseSession/index.tsgatesvalidatedPublicDomainSubtitlebehindif (addWorkEmailTaskReport && response?.message === CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR), standard onboarding (whereaddWorkEmailTaskReportisundefined) only setsOnyx.merge(ONYXKEYS.NVP_ONBOARDING, {isMergingAccountBlocked: true})with no error translation key.MergeIntoAccountAndLogin(src/libs/actions/Session/index.tsandtests/ui/WorkEmailOnboarding.tsx):When an unvalidated user enters a work email belonging to an existing account (
shouldValidate: true) and submits the validation code toMergeIntoAccountAndLogin, the backend blocks non-mergeable accounts either by returningisMergingAccountBlocked: trueinonyxData(e.g.,jsonCode: 501inMergeIntoAccountAndLoginBlockMergeattests/ui/WorkEmailOnboarding.tsx#L150-L166) or via theelsebranch ofresponse?.jsonCode === CONST.JSON_CODE.EXP_ERROR(666). In both cases,ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYwas cleared tonullinoptimisticData, soOnboardingMergingAccountBlockedViewrendersonboarding.mergeBlockScreen.subtitle.Because
onboarding.mergeBlockScreen.subtitleinsrc/languages/*.tsstill holds the legacy copy ("We couldn’t add ${workEmail}. Please try again later in Settings or chat with Concierge for guidance."), the user is not told to sign in with their work email and merge fromAccount > Security > Merge accounts.What changes do you think we should make in order to solve the problem?
Update
onboarding.mergeBlockScreen.subtitleacross all 11 supported locale files (src/languages/en.ts,de.ts,el.ts,es.ts,fr.ts,it.ts,ja.ts,nl.ts,pl.ts,pt-BR.ts,zh-hans.ts), preserving the(workEmail: string | undefined) => stringfunction signature and using each locale's exact navigation path forAccount > Security > Merge accounts:src/languages/en.tssrc/languages/de.tssrc/languages/el.tssrc/languages/es.tssrc/languages/fr.tssrc/languages/it.tssrc/languages/ja.ts(matchingsecurityPage.mergeAccount'アカウントを統合')src/languages/nl.tssrc/languages/pl.ts(matchingcommon.security'Bezpieczeństwo'andsecurityPage.mergeAccount'Połącz konta')src/languages/pt-BR.tssrc/languages/zh-hans.tstests/ui/WorkEmailOnboarding.tsx)'should display onboarding merge block screen content correctly'intests/ui/WorkEmailOnboarding.tsx(L1287-L1314) already assertsexpect(screen.getByText(TestHelper.translateLocal('onboarding.mergeBlockScreen.subtitle', workEmail))).toBeOnTheScreen()afterMergeIntoAccountAndLoginBlockMerge().AddWorkEmailis rejected with403 Forbiddenduring standard onboarding (without a Concierge task report),OnboardingMergingAccountBlockedViewrenders the updatedonboarding.mergeBlockScreen.subtitleinterpolated withworkEmail.What alternative solutions did you explore? (Optional)
We also evaluated keeping
onboarding.mergeBlockScreen.subtitlefor unknownAddWorkEmail666failures and introducing a dedicated key (onboarding.mergeBlockScreen.existingAccountSubtitle) set when the work email belongs to an existing account.onboarding.mergeBlockScreen.subtitledirectly matches the issue specification verbatim ("This is the fallback subtitle,onboarding.mergeBlockScreen.subtitle, insrc/components/OnboardingMergingAccountBlockedView.tsx... Solution: When the work email belongs to an existing account, show: 'Sign in with [work email] and merge this account from Account > Security > Merge accounts.' Update all supported locales"), covers bothAddWorkEmail(403 Forbidden) andMergeIntoAccountAndLogin(501viaonyxDataand666), and avoids writing an email-parameterized key toONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY.AddWorkEmail666errors (e.g.,500) to retain the generic fallback while existing-account blocks show the merge instructions viaonboarding.mergeBlockScreen.existingAccountSubtitle, three things must be handled together so no path breaks:AddWorkEmail(src/libs/actions/Session/index.ts#L1790), setONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYto'onboarding.mergeBlockScreen.existingAccountSubtitle'wheneverresponse?.message === CONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR(removing theaddWorkEmailTaskReport &&gate).MergeIntoAccountAndLogin(src/libs/actions/Session/index.ts#L1858-L1873), set'onboarding.mergeBlockScreen.existingAccountSubtitle'both in theresponse?.jsonCode === CONST.JSON_CODE.EXP_ERROR(666) non-invalid-code branch and whenonboardingUpdate?.valuesetsisMergingAccountBlocked: true(such asjsonCode: 501inMergeIntoAccountAndLoginBlockMergeattests/ui/WorkEmailOnboarding.tsx#L150-L166, which bypasses thejsonCode === 666branch).src/pages/OnboardingWorkEmail/BaseOnboardingWorkEmail.tsx#L282-L291, passworkEmail(or skipmergeBlockScreenkeys) when callingaddWorkEmailFormError(translate(workEmailErrorTranslationKey, workEmail)), because callingtranslate(workEmailErrorTranslationKey)withoutworkEmailinterpolates"undefined"into the form error state.bhomvratrai-glitch commentedon Oct 26, 2026
Contributor Details
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user enters a work email during onboarding that belongs to an existing Expensify account, the blocking screen displays a generic error message ("We couldn’t add [work email]. Please try again later in Settings or chat with Concierge for guidance.") instead of explaining how to sign in with the work email and merge the accounts.
What is the root cause of that problem?
In
src/libs/actions/Session/index.ts(lines 1790–1792):ONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYis only set to'onboarding.mergeBlockScreen.validatedPublicDomainSubtitle'whenaddWorkEmailTaskReportis defined (i.e. task-based Concierge flow). In standard onboarding,addWorkEmailTaskReportisundefined.isMergingAccountBlocked: truewithout settingONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY.src/components/OnboardingMergingAccountBlockedView.tsx(lines 48–49),getErrorSubtitlefalls back toonboarding.mergeBlockScreen.subtitle:validatedPublicDomainSubtitleinsrc/languages/en.tsstill contains the older phrasing rather than the requested concise copy:Sign in with [work email] and merge this account from Account > Security > Merge accounts.What changes do you think we should make in order to solve the problem?
src/libs/actions/Session/index.ts:Remove the
addWorkEmailTaskReport &&condition so that anyCONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERRORduring onboarding sets'onboarding.mergeBlockScreen.validatedPublicDomainSubtitle':validatedPublicDomainSubtitleacross all 11 supported locales insrc/languages/*.ts:en.ts:(workEmail) => \Sign in with ${workEmail} and merge this account from Account > Security > Merge accounts.``es.ts:(workEmail) => \Inicia sesión con ${workEmail} y fusiona esta cuenta desde Cuenta > Seguridad > Fusionar cuentas.``de.ts:(workEmail) => \Melden Sie sich mit ${workEmail} an und führen Sie dieses Konto unter Konto > Sicherheit > Konten zusammenführen zusammen.``fr.ts:(workEmail) => \Connectez-vous avec ${workEmail} et fusionnez ce compte depuis Compte > Sécurité > Fusionner les comptes.``it.ts:(workEmail) => \Accedi con ${workEmail} e unisci questo account da Account > Sicurezza > Unisci account.``nl.ts:(workEmail) => \Meld je aan met ${workEmail} en voeg dit account samen via Account > Beveiliging > Accounts samenvoegen.``pl.ts:(workEmail) => \Zaloguj się jako ${workEmail} i scal to konto w Konto > Zabezpieczenia > Scal konta.``pt-BR.ts:(workEmail) => \Faça login com ${workEmail} e mescle esta conta em Conta > Segurança > Mesclar contas.``ja.ts:(workEmail) => \${workEmail} でサインインし、「アカウント」>「セキュリティ」>「アカウントの統合」からこのアカウントを統合してください。``zh-hans.ts:(workEmail) => \使用 ${workEmail} 登录,并在“账户 > 安全 > 合并账户”中合并此账户。``el.ts:(workEmail) => \Συνδεθείτε με το ${workEmail} και συγχωνεύστε αυτόν τον λογαριασμό από Λογαριασμός > Ασφάλεια > Συγχώνευση λογαριασμών.``What alternative solutions did you explore? (Optional)
Changing
onboarding.mergeBlockScreen.subtitlefallback directly instead ofvalidatedPublicDomainSubtitle:Rejected because
subtitleis used as the generic fallback for unspecified errors, whilevalidatedPublicDomainSubtitlespecifically handles existing validated public domain accounts. Removing theaddWorkEmailTaskReportguard correctly categorizes existing account errors across all onboarding entry points.Tested Branch & Commit
fix/105015-explain-how-to-merge-work-emaile9e6cfcfkhizzcr7 commentedon Oct 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A user signs up with a personal email or phone number, then enters a work email that already belongs to another Expensify account during onboarding. The merge-blocked screen shows only the generic fallback "We couldn't add [work email]", with no reason for the failure and no next step for the user.
What is the root cause of that problem?
OnboardingMergingAccountBlockedView dispatches on ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY: validatedPublicDomainSubtitle and domainControlledSubtitle each get a specific subtitle, but the existing-account failure sets no specific key, so getErrorSubtitle falls through to the generic onboarding.mergeBlockScreen.subtitle. The component already receives workEmail; it simply has no existing-account branch to use it with.
What changes are you going to make to fix the problem?
What will you verify?
Repro: sign up with a personal email, enter an existing work email in onboarding, and confirm the blocked screen now shows the sign-in-and-merge instruction with the work email interpolated. Confirm other merge-block reasons still show their own (or the generic) subtitle, and that the confirm-button flow back to the onboarding purpose/employees step is unchanged.
Enes2553 commentedon Oct 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
During onboarding, when a user signs up with a personal email or phone number and attempts to add a work email that already belongs to another existing Expensify account, the blocking screen (
OnboardingMergingAccountBlockedView) displays an unhelpful generic error message ("We couldn't add [work email]...") instead of explaining that they should sign in with the work email and merge fromAccount > Security > Merge accounts.What is the root cause of that problem?
In
src/libs/actions/Session/index.ts(lines 1786–1794):When attempting to add an existing work email during onboarding, specific error keys are only set for
WORK_DOMAIN_CONTROLLED_ERRORandWORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR. When the error is due to the work email already belonging to another account (e.g.ALREADY_EXISTS/ standard merge conflict), no specific translation key is merged intoONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEY.As a result,
OnboardingMergingAccountBlockedView.tsx(getErrorSubtitle, lines 48-50) falls through to the generic fallback subtitle:translate('onboarding.mergeBlockScreen.subtitle', workEmail)which does not inform the user why it failed or how to merge.
What changes do you think we should make in order to solve the problem?
In
src/languages/en.ts(andsrc/languages/es.ts):In
src/libs/actions/Session/index.tsinside the error handler for adding work email:Identify when the backend returns the error indicating the email already exists on another account, and merge the new translation key:
In
src/components/OnboardingMergingAccountBlockedView.tsx, insidegetErrorSubtitle:Ensure the new key interpolates
workEmail:What alternative solutions did you explore? (Optional)
Changing the generic fallback string directly; however, that fallback is also used for other unexpected network/server errors during merge, so introducing an explicit dedicated translation key preserves distinct messaging for genuine server errors versus existing-account merge guidance.
Test Result / Verification:
"Sign in with [work email] and merge this account from Account > Security > Merge accounts."
{0}correctly displays the entered work email.bhomvratrai-glitch commentedon Oct 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
During onboarding, when a user who signed up with a phone number or personal email attempts to add a work email that already belongs to an existing Expensify account, the blocked screen (
OnboardingMergingAccountBlockedView) displays an uninformative generic fallback subtitle ("We couldn't add [email]. Please try again later in Settings or chat with Concierge for guidance.") instead of guiding the user to sign in with their work email and merge accounts from Account > Security > Merge accounts.What is the root cause of that problem?
src/libs/actions/Session/index.ts(AddWorkEmail, lines 1785–1794), specific translation keys forONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYare only merged whenresponse?.messageequalsCONST.WORK_DOMAIN_CONTROLLED_ERRORorCONST.WORK_EMAIL_VALIDATED_PUBLIC_DOMAIN_ERROR. When the work email belongs to an existing account (or causes a merge conflict rejection without matching those two strings),errorTranslationKeyis undefined, andONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYis not updated before settingisMergingAccountBlocked: true.src/components/OnboardingMergingAccountBlockedView.tsx(getErrorSubtitle, lines 37–50), becauseonboardingErrorMessageis unset/undefined, the component falls through to the generic fallback on line 49:return translate('onboarding.mergeBlockScreen.subtitle', workEmail);which displays the generic "We couldn't add [work email]" message without explanation or next steps.
What changes do you think we should make in order to solve the problem?
Locale updates:
In
src/languages/en.tsandsrc/languages/es.tsunderonboarding.mergeBlockScreen, addexistingAccountSubtitle:(workEmail: string | undefined) => \Sign in with ${workEmail} and merge this account from Account > Security > Merge accounts.``(workEmail: string | undefined) => \Inicia sesión con ${workEmail} y fusiona esta cuenta desde Cuenta > Seguridad > Fusionar cuentas.`*(Note: Alternatively,validatedPublicDomainSubtitle` already contains this exact string and can be reused as the standard merge-account instruction).*Session action update:
In
src/libs/actions/Session/index.ts(AddWorkEmailerror handling, lines 1785–1794):When
response?.jsonCode === CONST.JSON_CODE.EXP_ERRORduring onboarding and the response indicates the email belongs to an existing account (or as the default blocking subtitle when adding an existing work email), setONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYto'onboarding.mergeBlockScreen.existingAccountSubtitle'(or'onboarding.mergeBlockScreen.validatedPublicDomainSubtitle').Blocked view subtitle interpolation:
In
src/components/OnboardingMergingAccountBlockedView.tsx(getErrorSubtitle, lines 37–44):Handle
existingAccountSubtitlealongsidevalidatedPublicDomainSubtitleanddomainControlledSubtitleto interpolateworkEmailviatranslate(onboardingErrorMessage, workEmail).What alternative solutions did you explore? (Optional)
onboarding.mergeBlockScreen.subtitle: Rejected because that fallback is also triggered on unexpected network or server failures where advising the user to sign in with that email would be inaccurate. Using an explicit key ensures targeted guidance for existing account conflicts while preserving generic messaging for true unexpected errors.Verification / Tests
"Sign in with [work email] and merge this account from Account > Security > Merge accounts." with the entered email correctly interpolated.
tests/unit/AddWorkEmailTest.tspass and add a test case verifyingONYXKEYS.ONBOARDING_ERROR_MESSAGE_TRANSLATION_KEYis set on existing account merge rejection.Contributor details
Your Expensify account email: bhomvratrai@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~016c1aa34b51059d42
22 remaining items
expensify-chore-bot commentedon Nov 18, 2026
This issue has not been updated in over 14 days. @marcaaron, @dmkt9 eroding to Weekly issue.
dmkt9 commentedon Nov 20, 2026
@marcaaron Could you take a look at this #105015 (comment) when you get a chance? Thanks
expensify-chore-bot commentedon Nov 23, 2026
@marcaaron Whoops! This issue is 2 days overdue. Let's get this updated quick!
expensify-chore-bot commentedon Nov 25, 2026
@marcaaron Huh... This is 4 days overdue. Who can take care of this?
marcaaron commentedon Nov 26, 2026
@dmkt9 Thanks. Let's go with MelvinBot's proposal: #105015 (comment)
dmkt9 commentedon Nov 27, 2026
@MelvinBot implement this #105015 (comment)
melvin-bot commentedon Nov 27, 2026
@dmkt9 I sent you a Slack DM to connect GitHub. I will continue the original request once you are connected.
MelvinBot commentedon Nov 27, 2026
🤖 Web test steps verification results: ❌ fail
Implemented in draft PR: Explain how to merge an existing work account during onboarding, including the
501case; all 43,907 Jest tests passed. Browser verification was blocked by a suspended session exposing zero page elements, so no browser behavior verdict is possible.Onboarding error guidance and Got it navigation
Blocked before onboarding after one retry. The 403/501/666 guidance, security-specific errors, generic fallback, and confirmation navigation remain unverified in-browser.view run · no recording available
expensify-chore-bot commentedon Dec 1, 2026
@marcaaron Huh... This is 4 days overdue. Who can take care of this?