Skip to content

Preserve runtime failures during service cleanup#50

Open
poulcarlsen53 wants to merge 1 commit into
WhiteDNS:mainfrom
poulcarlsen53:fix/runtime-startup-state-reliability
Open

Preserve runtime failures during service cleanup#50
poulcarlsen53 wants to merge 1 commit into
WhiteDNS:mainfrom
poulcarlsen53:fix/runtime-startup-state-reliability

Conversation

@poulcarlsen53

Copy link
Copy Markdown

What changed

This cleans up a few runtime handoff and failure-state edges:

  • preserves a persisted failed runtime state when cleanup for the same session later marks the service as stopped
  • adds unit coverage for that state transition
  • writes runtime and scan launch request JSON with AtomicFile instead of direct writeText
  • converts scan foreground-start failures into a persisted failed scan state
  • catches scan service launch exceptions in the ViewModel so the UI does not stay stuck on Starting

Why

Startup failures could be reported briefly and then overwritten by generic cleanup as a clean stop. If the UI process missed the broadcast or reopened later, the useful failure reason was gone. The launch request files are also part of the ViewModel-to-service handoff, so direct writes leave a small window where a service can read truncated JSON after interruption.

Verification

  • ./gradlew :app:testDebugUnitTest --tests shop.whitedns.client.runtime.WhiteDnsRuntimeStateStoreTest --no-daemon
  • ./gradlew :app:compileDebugSources --no-daemon

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