feat: wait for channel to open before triggering initial state updates

This commit is contained in:
Adam Shiervani 2025-11-12 11:12:12 +01:00
parent 5fb4c629dd
commit e762574375
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":