Greenstand / Greenstand/treetracker-android

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

Open
#1,217 1 comment 0 reactions 1 assignee Claimed by @Elforama View on GitHub
2.3 refactor
Dominant language
Kotlin
Stars
101
Forks
116
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.