Skip to content

[Due for payment 2026-07-13] Country selection screen errors out when opened without a country already selected #94629

Description

@blimpich

Problem

The Country selection screen can fail to load — it shows an error instead of the list of countries when it is opened without a country already selected (for example, when the app is relaunched while that screen was open, or the screen is reached via a direct link). When this happens the user cannot pick a country.

Reproduction Steps

Observed in production on iOS.

  1. Go to Settings > Profile > Personal Details > Address.
  2. Tap the Country field to open the country selector.
  3. Force-quit the app while the country selector is the active screen.
  4. Relaunch the app (navigation state restores the country selector).

Expected Behavior: The country list loads and a country can be selected.

Actual Behavior: The screen errors and the country list does not render.

Solution

The screen should tolerate the navigation parameters being absent (treat it as "no country selected") instead of erroring.

Extra context

Sentry: APP-G8YTypeError: Cannot read property 'country' of undefined, culprit DynamicCountrySelectionPage. First seen 2026-06-25, 7 events / 1 user, handled: yes (caught by the error boundary). Telemetry shows the error firing ~8s after a cold start, which points to navigation state restoration landing on the screen with no params.

Root cause: DynamicCountrySelectionPage reads route.params.country directly, but React Navigation hands back undefined params when the screen is entered with none, so the property read throws. Everything downstream already tolerates an undefined country, so the fix is a single optional chain (route.params?.country).

– written by Claude on Ben's behalf

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions