Skip to content

fix: discard stale recorder services that never received settings#161

Open
cizra wants to merge 1 commit into
Myzel394:masterfrom
cizra:alibi/fix-existing-crashes
Open

fix: discard stale recorder services that never received settings#161
cizra wants to merge 1 commit into
Myzel394:masterfrom
cizra:alibi/fix-existing-crashes

Conversation

@cizra

@cizra cizra commented May 25, 2026

Copy link
Copy Markdown

After a process crash, Android could restart a recorder service and reconnect the UI to it without the model ever calling init() with the saved settings. The very first access to the settings lateinit then threw UninitializedPropertyAccessException, crashing the UI as soon as it bound.

Expose hasInitializedSettings() on IntervalRecorderService and have BaseRecorderModel detect stale services on bind, drop them, and start a fresh one instead of binding to invalid state.

Code changes by Claude Opus running inside Pi.dev. I built and tested this commit, it works fine in my phone.
Depends on #158 to build and run.

After a process crash, Android could restart a recorder service and
reconnect the UI to it without the model ever calling init() with the
saved settings. The very first access to the `settings` lateinit then
threw UninitializedPropertyAccessException, crashing the UI as soon as
it bound.

Expose `hasInitializedSettings()` on IntervalRecorderService and have
BaseRecorderModel detect stale services on bind, drop them, and start
a fresh one instead of binding to invalid state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant