Skip to content

Migrate to type-safe navigation routes and harden the org link flow #1217

Description

@cynthiabondi

Related PRs: #1196 #1197

Summary
Upgrade Compose Navigation to use type-safe routes, and fix several critical safety issues discovered during an audit of the org link flow.

Motivation
String-based routes are fragile and error-prone. The org link flow audit revealed data loss risks, crash vectors on malformed deep links, force-unwrap crashes, main-thread blocking, and scope lifecycle bugs.

Acceptance criteria

  • Migrate all navigation to typed routes (replacing string literals)
  • Fix tree save data loss — await save before navigating
  • Wrap deep link JSON parsing in try/catch with fallback to default org
  • Replace all force-unwrap (!!) with safe access and fallback behaviour
  • Replace runBlocking on main thread with suspend functions
  • Add re-entrance guards for Koin scope lifecycle
  • Add RouteRegistry with route validation and stable alias support
  • Add bounds checking in navFromNewUserCreation()
  • Replace stringly-typed feature flags with OrgFeature enum

References
Closes #1196, #1197

Metadata

Metadata

Assignees

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions