mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-10-20 20:22:17 +00:00
#506 fixed the root cause of the stuck "Connecting…" foreground notification (the foss UnifiedPush wake no longer ANRs the main thread, so the lifecycleScope `tunnelClient.state` collector in observeStateChanges runs normally and reconciles to "Connected"). This adds a belt-and-suspenders reconcile so a tunnel whose socket is genuinely ESTABLISHED can never be left showing "Connecting…", independent of whether that Main-dispatcher collector was momentarily starved. reconcileNotification() re-renders the foreground notification from `tunnelClient.state.value` (ground truth), reusing updateNotification() so the copy is identical. It is called from two hooks that can't be missed: - in onStartCommand's coroutine right after awaitReady(), on every wake; - immediately after a successful connect() returns (socket established). StateFlow replays its current value to new collectors, so a transition is not normally dropped — the collector is not a true single point of failure. This reconcile is purely defensive hardening; no user-facing flow changes. Co-authored-by: monkopedia-coder <monkopedia+coder@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| build.gradle.kts | ||