Full Changelog: v1.4.0...v1.4.1
fix(overlay): resolve overlay service initialization hang and UI visibility state
Fixed a critical bug introduced in the initial background sync implementation where the overlay bubble remained invisible and stuck at 00:00:00.
-
Bug Root Cause & Acknowledgment:
- The newly introduced async history sync block was launched as a child coroutine on
serviceScope. - Inside
startTimerLoop(), the loop-protection guard checked if any child ofserviceScopewas active (serviceScope.coroutineContext[Job]?.children?.any { it.isActive }). - Because the background sync coroutine was running, this check evaluated to
true, causingstartTimerLoop()to silently return and prevent the overlay loop from running entirely.
- The newly introduced async history sync block was launched as a child coroutine on
-
Fixes Implemented:
- Replaced the overly broad coroutine-children check with a dedicated
timerRunningboolean flag to cleanly prevent duplicate timer loops without conflicts. - Declared
private var timerRunning = falsestate variable. - Set the overlay's initial state to hidden (
bubbleView.isVisible = false) upon startup, ensuring it only displays for selected/mindful apps once the timer loop resumes control.
- Replaced the overly broad coroutine-children check with a dedicated