You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-login and retry on PERMISSION_DENIED instead of dropping impulses
In `ha` mode with doorStatusSupported=false the gateway idle-expires the
session token within minutes, but TokenExpirationTime is hardcoded to 6h so
autoLoginBisecur won't re-login, and SetState swallowed the gateway's
PERMISSION_DENIED (12) response (logged it, returned nil) - so presses failed
silently with no error and no re-login.
- sdk/Client.go: SetState surfaces the ErrorResponse instead of returning nil;
isErrorResponse returns the typed *payload.ErrorResponse so callers can
inspect the gateway error code.
- cli/homeAssistant/actions.go: on PERMISSION_DENIED from SetState, forceReLogin
and retry the impulse once, mirroring the official app (InfoCenter.onMCPError
-> AppCache.relogin).
- forceReLogin retries the login up to 3x (2s apart) and drops the pre-login
logout: the gateway reliably kills the first login after a stale session
(sends a LOGOUT and resets before replying, so attempt 1 times out; attempt 2
succeeds). This is the flakiness noted in the TokenExpirationTime TODO.
0 commit comments