Conversation
|
not sure how i feel about |
MohamadJaara
left a comment
There was a problem hiding this comment.
question about waiting to connected
f5a4958 to
0269d93
Compare
Automated PR ReviewGenerated by SummaryThis PR addresses a UI flicker issue where the "Decrypting messages" or "Waiting for network" banner briefly flashes on app start, even when the device is online and sync completes quickly. The root causes were identified as incorrect mapping of the The solution involves:
Bugs
Architectural Issues
Improvements / Recommendations
Open Questions / Coverage Notes
Overall, this PR provides a well-reasoned and clean fix for the banner flicker issue with thoughtful debounce handling and state mapping. The addition of the automated PR review workflow should be reviewed separately. |
Ups 🫰🟨This PR is too big. Please try to break it up into smaller PRs. |
This reverts commit 9db6734.
1e56c18 to
2f31d5e
Compare
|



https://wearezeta.atlassian.net/browse/WPB-23994
https://wearezeta.atlassian.net/browse/WPB-23994
What's new in this PR?
Issues
On every app start, the "Decrypting messages" or "Waiting for network" banner flashed briefly in the top app bar, even when the device was online and sync completed quickly (under one second).
Causes (Optional)
Two independent bugs combined to produce the flash:
SyncState.Waiting was treated as a connectivity problem.
Waiting is a pure pre-initialisation state — the sync worker has not been scheduled yet and carries no information about network health. Mapping it to WaitingConnection caused "Waiting for network" to appear immediately on every
cold start, before sync even began.
The debounce operator was placed outside flatMapLatest.
currentSessionFlow() is a plain SQLDelight Flow that can emit multiple Success values at startup, causing flatMapLatest to restart its inner flow repeatedly. The debounce operator sat outside this restart boundary, so timers from
cancelled inner flows survived and fired with stale state — producing the "Decrypting messages" flash even after sync had completed.
Solutions
window, the timer is cancelled and no banner ever appears.
extra delay for the ongoing-call bar (600 ms, to absorb rapid mute/unmute changes without flickering). Everything else passes through at 0 ms.