mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-03 03:44:54 +00:00
FcmTokenRegistrar.registerToken was a no-op that only logged. When FCM rotated the device token mid-session, the relay kept the stale token until the next reconnect (could be hours). The pull-on-connect path in TunnelForegroundService covered the disconnected case but not the live-session case. Inject TunnelClient into FcmTokenRegistrar; on token refresh, push via TunnelClient.sendFcmToken when state is CONNECTED or ACTIVE. Treat CONNECTING as disconnected to avoid racing a half-open connection. Swallow send exceptions so a racing disconnect can't crash the FCM service thread — the next wake's pull will re-sync. Drop registerCurrentToken() and the RouseApplication.onCreate call site. It was pure overhead: the tunnel already pulls a fresh token on every connect, so a startup push adds nothing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| build.gradle.kts | ||