fix: Defer setting connected state until after nodeDB load (#4505)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-02-08 11:40:12 -06:00 committed by GitHub
parent 826bffe230
commit 7bcc51863f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -85,8 +85,6 @@ constructor(
} else {
myNodeInfo = newMyNodeInfo
Logger.i { "myNodeInfo committed successfully" }
connectionStateHolder.setState(ConnectionState.Connected)
serviceBroadcasts.broadcastConnection()
connectionManager.onRadioConfigLoaded()
}
@ -123,6 +121,8 @@ constructor(
}
nodeManager.isNodeDbReady.value = true
nodeManager.allowNodeDbWrites.value = true
connectionStateHolder.setState(ConnectionState.Connected)
serviceBroadcasts.broadcastConnection()
connectionManager.onNodeDbReady()
}
}

View file

@ -118,7 +118,7 @@ constructor(
}
private fun onConnectionChanged(c: ConnectionState) {
if (connectionStateHolder.connectionState.value == c) return
if (connectionStateHolder.connectionState.value == c && c !is ConnectionState.Connected) return
Logger.d { "onConnectionChanged: ${connectionStateHolder.connectionState.value} -> $c" }
sleepTimeout?.cancel()