Skip to content

fix(navigation): prevent duplicate Sheet key crash in single-route navigation#741

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/sheet-duplicate-key-crash
May 20, 2026
Merged

fix(navigation): prevent duplicate Sheet key crash in single-route navigation#741
bmc08gt merged 1 commit into
code/cashfrom
fix/sheet-duplicate-key-crash

Conversation

@bmc08gt
Copy link
Copy Markdown
Collaborator

@bmc08gt bmc08gt commented May 20, 2026

The single-route navigateTo(route) extension called navigate() directly without checking whether a sheet was already open. This allowed a second Sheet(TokenDiscovery) to land on the backstack during a dismiss animation, crashing SaveableStateProvider with 'Key was used multiple times'.

  • Single-route navigateTo now defers via pendingSheetDismiss when a sheet is already present, matching the multi-route overload behavior
  • Add Sheet dedup guard to the ClearAll navigate branch
  • Add async duplicate Sheet sanitization in AppNavHost as a safety net
  • Add 4 test cases covering the single-route dismiss-then-replace flow

@bmc08gt bmc08gt self-assigned this May 20, 2026
@github-actions github-actions Bot added type: fix Bug fix area: ui Compose UI, theme, components, resources area: deeplinks Deep link handling, URL routing, and link parsing labels May 20, 2026
…vigateTo

The single-route navigateTo(route) extension called navigate() directly
without checking whether a sheet was already open. This allowed a second
Sheet(TokenDiscovery) to land on the backstack during a dismiss animation,
crashing SaveableStateProvider with 'Key was used multiple times'.

- Single-route navigateTo now defers via pendingSheetDismiss when a sheet
  is already present, matching the multi-route overload behavior
- Add Sheet dedup guard to the ClearAll navigate branch
- Add async duplicate Sheet sanitization in AppNavHost as a safety net
- Add 4 test cases covering the single-route dismiss-then-replace flow
@bmc08gt bmc08gt force-pushed the fix/sheet-duplicate-key-crash branch from 0a70257 to fb6925e Compare May 20, 2026 13:43
@bmc08gt bmc08gt merged commit a3e9358 into code/cash May 20, 2026
2 checks passed
@bmc08gt bmc08gt deleted the fix/sheet-duplicate-key-crash branch May 20, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: deeplinks Deep link handling, URL routing, and link parsing area: ui Compose UI, theme, components, resources type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant