mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Replaces two coroutine anti-patterns flagged by the architecture audit: * FirmwareUpdateViewModel.onCleared() was using GlobalScope.launch to run cleanup work that must outlive the ViewModel scope. Introduce a new ApplicationCoroutineScope marker interface + Koin @Single binding in core/common, backed by SupervisorJob() + ioDispatcher, and inject it into the VM. NonCancellable is preserved so shutdown work still cannot be interrupted. Verified end-to-end by the KoinVerificationTest full-graph check. * Six sites in feature/settings (android+jvm LogExporter/PrefExporter) and core/ui (android+jvm PlatformUtils) were hardcoding Dispatchers.IO. Switch to the project's injectable ioDispatcher property so tests can substitute a test dispatcher without reflection. Dispatchers.Main sites in LogExporter are intentionally left alone — they are fully test-swappable via Dispatchers.setMain() and there is no existing mainDispatcher property to inject. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| androidMain/kotlin/org/meshtastic/core/common | ||
| commonMain/kotlin/org/meshtastic/core/common | ||
| commonTest/kotlin/org/meshtastic/core/common/util | ||
| iosMain/kotlin/org/meshtastic/core/common/util | ||
| jvmAndroidMain/kotlin/org/meshtastic/core/common/util | ||
| jvmMain/kotlin/org/meshtastic/core/common/util | ||