Skip to content

Country and state reset on the personal bank account address step #105282

Closed as duplicate

Description

@rafecolton

Problem

On the personal bank account flow's "What's your address?" step, the country can't be changed and the state can't be typed. Both fields snap back to their saved values after every change.

Steps to reproduce

  1. Sign in with an account that has no bank account added.
  2. Go to Settings > Wallet > Add bank account and choose to connect manually.
  3. Enter the routing and account numbers and continue to the "What's your address?" step.
  4. Select a country other than the United States.
  5. Type a value in the "State / Province" field.

Expected result

The selected country and the typed state stay in the form.

Actual result

The country resets to the saved value, and the state field clears after each keystroke.

Cause

AddressStep builds its address object from Onyx on every render and lists that object as a dependency of the effect that syncs form state from Onyx. The object is new on every render, so the effect runs after every render and resets currentCountry and state. Country and state are the only controlled inputs in AddressForm, so they are the only fields that reset.

Fix

#105281

Issue OwnerCurrent Issue Owner: @heekinho

Activity

  1. rafecolton commented on Oct 28, 2026

    @rafecolton
    MemberAuthor

    @MelvinBot where was this regression introduced?

  2. MelvinBot commented on Oct 28, 2026

    @MelvinBot
    Contributor

    The regression came from [No QA] Disallow manual memoization in compiled React code (Expensify/App#104522). That PR merged on 2026-10-26 in commit 6ad3bf6.

    The PR removed the useMemo around address in AddressStep.tsx. The sync effect still lists address as a dependency. address is now a new object on every render, so the effect resets currentCountry and state after each render.

    Details
    • The effect that lists address in its dependencies existed before that PR. It was safe while useMemo kept address stable. The PR's diff for this file only removed the useMemo wrapper and left the effect unchanged.
    • Only two commits touch this file. The other one, from July, just moved the file into the AddPersonalBankAccountPage folder.
    • The PR changed 932 files and was marked [No QA]. Other components where it removed useMemo from an object that an effect still depends on could have the same bug.
    • Current effect: AddressStep.tsx:64-72

    view run

  3. rafecolton commented on Oct 28, 2026

    @rafecolton
    MemberAuthor

    Heads up @roryabraham @mountiny ☝️ Asked about regression tests in #qa

  4. roryabraham commented on Oct 28, 2026

    @roryabraham
    Contributor

    thanks for finding and reporting it! Consolidating on #105210

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

Metadata

Metadata

Labels

ImprovementItem broken or needs improvement.ReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions