Conversation
|
If multiple happen and force is true in any of them, won't that cause the same issue where the external bus call itself is only able to track one at once? |
|
Why would there be multiple force requests? I think it is only used when loading the app and hitting a wrong token? |
|
The problem scenario I'm imagining is something like…
would cause 1 and 2 to be lost because of how the callback works in the external bus, if I am understanding that side of things correctly. |
|
I don't think that scenario will ever happen, I'll check the code in a sec |
|
We only do a force when we load the core and get an invalid auth. The force parameter should trigger the reauth flow in the app, as if it was not authenticated. Since we are not connected at that point, it is not possible that a |
|
My read of that (and I think what I have seen) is that we may use an invalid-due-to-expired auth token and that triggers the forced flow, so it's not just logout events, or am I wrong about that auth error's cases? |
|
this is not a logout event, it is when the apps starts, and the auth token is no longer valid (removed?). When the app starts we connect to HA and try to get the access token (without force) from the app, if that fails with an invalid auth error, we will call refresh access token with force. That means all previous promises can be discarded as we will re-do the entire auth (login page). After the re-login of the user, we will try to create the connection again. |
|
Every now and then i can't get a reconnection to my home assistant after the connection is broken (ex. duo to a home assistant restart) with the android app. The frontend just shows the message "Connection lost. Reconnecting..." for ever. I had never problems with HA releases before this PR. Did some debugging the last couple of days and tracked down the problem to this PR. I think this is reproducible with following steps:
While HA is restarting the frontend tries to reconnect in background.
On the home assistant side there are following messages. Which explains this process above. Long story shortMaybe here should be a check if the promise is rejected. If it is reject then do not return the reject promise. Instead do the stuff below (call getExternalAuth etc.) If the promise is resolved, then return the promise. I hope i could describe the problem understandable. Best regards |
|
Hi Chris, thanks for your lengthy tracking, but could you create an issue for this instead of commenting on a merged PR? Thanks! |
Proposed change
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: