Skip to content

fix(ramps-controller): refresh countries catalog on app startup#9261

Open
amitabh94 wants to merge 2 commits into
mainfrom
fix/tram-3682-countries-catalog-refresh-on-start
Open

fix(ramps-controller): refresh countries catalog on app startup#9261
amitabh94 wants to merge 2 commits into
mainfrom
fix/tram-3682-countries-catalog-refresh-on-start

Conversation

@amitabh94

@amitabh94 amitabh94 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Explanation

Stale persisted countries catalog data caused preset amounts (e.g. $100 / $250 / $500) to stay wrong after app restarts until the user changed region, even when the API had updated values.

This change is controller-only in @metamask/ramps-controller — no MetaMask Mobile or portfolio changes.

  • Mark the countries catalog as non-persisted (persist: false) so restarts do not reuse stale catalog data.
  • On init(), always refetch countries via getCountries() (including when userRegion is already set).
  • After each successful getCountries(), re-sync userRegion preset amounts from the fresh catalog via #syncUserRegionFromCountriesCatalog.
  • Tests cover init refetch, userRegion re-sync, and persistence metadata.

Consumers need a new @metamask/ramps-controller release; mobile can pick it up via the usual Core dependency bump.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Made with Cursor

amitabh94 and others added 2 commits June 24, 2026 23:21
Stop persisting the countries catalog and force-refetch via init() so
preset amounts stay in sync after app restarts.

TRAM-3682

Co-authored-by: Cursor <cursoragent@cursor.com>
TRAM-3682

Co-authored-by: Cursor <cursoragent@cursor.com>
@amitabh94 amitabh94 requested review from a team as code owners June 25, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant