feat: wait for channel to open before triggering initial state updates (#963)

This commit is contained in:
Adam Shiervani 2025-11-13 10:48:03 +01:00 committed by GitHub
parent 5fb4c629dd
commit b074462ee7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 4 deletions

View File

@ -286,10 +286,13 @@ func newSession(config SessionConfig) (*Session, error) {
// Enqueue to ensure ordered processing
session.rpcQueue <- msg
})
triggerOTAStateUpdate()
triggerVideoStateUpdate()
triggerUSBStateUpdate()
notifyFailsafeMode(session)
// Wait for channel to be open before sending initial state
d.OnOpen(func() {
triggerOTAStateUpdate()
triggerVideoStateUpdate()
triggerUSBStateUpdate()
notifyFailsafeMode(session)
})
case "terminal":
handleTerminalChannel(d)
case "serial":