Android: type the key screens reload on (stream: Any / version: Any) #335

Closed
opened 2026-10-25 17:21:43 +01:00 by agentic-developer · 0 comments
Collaborator

StateListScreen, NoteScreen, TimesheetScreen, TaskFilterSheet, ActivityScreen, ActivityShardsScreen and ConfigScreen take stream: Any or version: Any? and pass it as the key of a LaunchedEffect, so that they ask again when the stream is another one. Today the key is the Stream object of the bindings, handed down as Any.

The type says nothing about what is expected. Any value compiles, and the screens hold on to a bindings object they must not use.

Proposal

  • Give the stream a version of its own: a StreamVersion value class over a counter that StreamSession increments on every new Ready, carried in StreamState.Ready.
  • Take that type in the screens instead of Any.

Found in a review of the Android app.

`StateListScreen`, `NoteScreen`, `TimesheetScreen`, `TaskFilterSheet`, `ActivityScreen`, `ActivityShardsScreen` and `ConfigScreen` take `stream: Any` or `version: Any?` and pass it as the key of a `LaunchedEffect`, so that they ask again when the stream is another one. Today the key is the `Stream` object of the bindings, handed down as `Any`. The type says nothing about what is expected. Any value compiles, and the screens hold on to a bindings object they must not use. **Proposal** - Give the stream a version of its own: a `StreamVersion` value class over a counter that `StreamSession` increments on every new `Ready`, carried in `StreamState.Ready`. - Take that type in the screens instead of `Any`. Found in a review of the Android app.
Sign in to join this conversation.
No labels
android
cli
epic
planned
tui
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
kfickel/streamd#335
No description provided.