Canadian users are unable to add a deposit-only personal bank account because the phone number validation requires a US phone number. The form silently rejects valid Canadian phone numbers at the client-side validation step, preventing the AddPersonalBankAccount API call from ever being made.
Slack thread: https://expensify.slack.com/archives/D0AGYJN9H47/p1778253602744309
Current behavior
In PhoneNumberStep.tsx:39, the phone validation checks both isValidPhoneNumber() AND isValidUSPhone():
if (!isValidPhoneNumber(phoneNumberWithCountryCode) || !isValidUSPhone(e164FormattedPhoneNumber)) {
errors.phoneNumber = translate('common.error.phoneNumber');
}
isValidUSPhone() only accepts numbers with region codes: US, PR, GU, VI, AS, MP. Canadian numbers (+1 with CA region code) are rejected even though Canada shares the +1 country calling code.
Expected behavior
Canadian phone numbers should be accepted in the deposit-only bank account setup flow (at minimum). The file is under InternationalDepositAccount/, which implies international support was intended.
Origin
This US-only phone validation was introduced in PR #75179 ("Change for personal bank account setup") by TaduJR on 2025-11-14.
Proposal
What is the root cause of that problem?
The isValidUSPhone() check in PhoneNumberStep.tsx uses parsePhoneNumber and compares the resolved regionCode against a hardcoded list of US territories (US, PR, GU, VI, AS, MP). Canada has its own region code CA despite sharing the +1 calling code with the US, so Canadian numbers are rejected.
What changes do you think we should make in order to solve the problem?
Add CA to the accepted region codes in the validation for the InternationalDepositAccount phone number step. Specifically:
- In
PhoneNumberStep.tsx:39, replace the isValidUSPhone() call with a new validation function (e.g., isValidNANPPhone()) that accepts both US territory AND Canadian region codes — or simply add CA to the validUSRegionCodes array in ValidationUtils.ts:289.
The safer approach is to create a separate function or add a parameter to isValidUSPhone rather than modifying its existing behavior, since other callers may intentionally require US-only validation.
What alternative solutions did you explore?
- Removing the
isValidUSPhone check entirely and relying only on isValidPhoneNumber() — this would accept any international phone, which may be too permissive if the backend requires NANP numbers.
- Adding a separate
isValidCanadianPhone() check — unnecessary since the real fix is just expanding the accepted region codes for this specific flow.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Ollyws
Canadian users are unable to add a deposit-only personal bank account because the phone number validation requires a US phone number. The form silently rejects valid Canadian phone numbers at the client-side validation step, preventing the
AddPersonalBankAccountAPI call from ever being made.Slack thread: https://expensify.slack.com/archives/D0AGYJN9H47/p1778253602744309
Current behavior
In
PhoneNumberStep.tsx:39, the phone validation checks bothisValidPhoneNumber()ANDisValidUSPhone():isValidUSPhone()only accepts numbers with region codes: US, PR, GU, VI, AS, MP. Canadian numbers (+1 with CA region code) are rejected even though Canada shares the +1 country calling code.Expected behavior
Canadian phone numbers should be accepted in the deposit-only bank account setup flow (at minimum). The file is under
InternationalDepositAccount/, which implies international support was intended.Origin
This US-only phone validation was introduced in PR #75179 ("Change for personal bank account setup") by
TaduJRon 2025-11-14.Proposal
What is the root cause of that problem?
The
isValidUSPhone()check inPhoneNumberStep.tsxusesparsePhoneNumberand compares the resolvedregionCodeagainst a hardcoded list of US territories (US, PR, GU, VI, AS, MP). Canada has its own region codeCAdespite sharing the+1calling code with the US, so Canadian numbers are rejected.What changes do you think we should make in order to solve the problem?
Add
CAto the accepted region codes in the validation for theInternationalDepositAccountphone number step. Specifically:PhoneNumberStep.tsx:39, replace theisValidUSPhone()call with a new validation function (e.g.,isValidNANPPhone()) that accepts both US territory AND Canadian region codes — or simply addCAto thevalidUSRegionCodesarray inValidationUtils.ts:289.The safer approach is to create a separate function or add a parameter to
isValidUSPhonerather than modifying its existing behavior, since other callers may intentionally require US-only validation.What alternative solutions did you explore?
isValidUSPhonecheck entirely and relying only onisValidPhoneNumber()— this would accept any international phone, which may be too permissive if the backend requires NANP numbers.isValidCanadianPhone()check — unnecessary since the real fix is just expanding the accepted region codes for this specific flow.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Ollyws