Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Potential UI update skip in `repeatOnLifecycle`

Open criticalAY opened this issue 8 months ago • 3 comments

Just curious and want to know what will happen if the app is in background and value is updated (lets say) lastValue check will see the new value when the app resumes, compare it to the new value property, and potentially skip the UI update.

Originally posted by @criticalAY in https://github.com/ankidroid/Anki-Android/pull/20192#discussion_r2768000507

criticalAY avatar Mar 05 '26 07:03 criticalAY

If the logic inside the collection block updates lastValue before the UI is actually updated, or if there is a mismatch in how lastValue is persisted versus how the flow emits, we might skip a critical UI refresh because the check thinks the state hasn't changed since the "last" (unprocessed) emission.

criticalAY avatar Mar 05 '26 08:03 criticalAY

I'd like to look into this potential issue. Could I get assigned to this?

HS0204 avatar Mar 05 '26 11:03 HS0204

Hi! I’d like to take a look at this issue and try to resolve it. Please assign it to me if it’s available.

Hammadtanveer avatar Mar 09 '26 07:03 Hammadtanveer