Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/migration/android-saved-state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Android SavedStateHandle audit

Tracks issue #497.

## Finding

Process-death state is already kept with `SavedStateHandle` in the places that need it:

- `android/app/src/main/java/com/ethosprotocol/ui/DeepLinkViewModel.kt`
- `android/app/src/main/java/com/ethosprotocol/services/DeepLinkRateLimiter.kt`, which takes
the handle as a parameter for its cooldowns, as the TwoFactorViewModel OTP limit does.

## Remaining work

1. Check the other view models in `ui/ViewModels.kt` (`AuthViewModel`, `SessionsViewModel`,
`TwoFactorViewModel`) for state that is lost on process death, and move only that state to
`SavedStateHandle`.
2. Add a restore test for each view model that changes.
9 changes: 9 additions & 0 deletions docs/migration/dynamic-member-lookup-decision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @dynamicMemberLookup on ViewModels: decision

Tracks issue #498.

## Decision

Not adopted. `@dynamicMemberLookup` forwards property names through a subscript, so the compiler
no longer checks that a member exists. A typo compiles and fails at runtime. The view models
use plain properties, which are checked at compile time, and the verbosity it removes is small.
18 changes: 18 additions & 0 deletions docs/migration/hilt-compose-state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Hilt with Compose: current state

Tracks issue #499.

## Finding

The integration is already in place:

- Nine view models carry `@HiltViewModel` (`android/app/src/main/java/com/ethosprotocol/ui/`),
including `AuthViewModel`, `SessionsViewModel`, `TwoFactorViewModel`, `DeepLinkViewModel` and
`NotificationPreferencesViewModel`.
- Compose screens obtain them through Hilt rather than by building them by hand.

## Remaining work

1. Add a short pattern note to `docs/` that shows `hiltViewModel()` in a composable and the
`@HiltViewModel` class beside it.
2. Check that every screen in `ui/screens/` gets its view model through `hiltViewModel()`.
24 changes: 24 additions & 0 deletions docs/migration/swift-concurrency-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Swift concurrency adoption plan

Tracks issue #500.

## Current state

- 38 Swift files use `async`.
- 25 files still use completion handlers or `DispatchQueue`. The largest are
`Sources/App/AppDelegate.swift`, `Sources/Services/AppAttestService.swift`,
`Sources/Services/CertificatePinning.swift`, `Sources/Services/NotificationService.swift`,
`Sources/Services/SilentNotificationService.swift`, `Sources/Services/SpotlightService.swift`
and `Sources/Services/VaultEventSocket.swift`.
- 64 places already use `@MainActor` or `actor`.

## Plan, in order

1. Services called only from `async` code: move `NotificationService` and `SpotlightService` to
`async` functions first. Their callers already await.
2. `VaultEventSocket`: wrap the socket callbacks in an `AsyncStream`, keeping the current API for
the callers that have not moved yet.
3. `AppDelegate` and `CertificatePinning` last. Both run at launch and in delegate callbacks, so
they need the most review.
4. `Sendable`: add it to types that cross actor boundaries as each service moves.
5. Actor isolation: keep UI-facing types on `@MainActor`, as they already are.
Loading