Closed bdraco closed 1 year ago
Patch coverage: 75.75
% and project coverage change: -0.01
:warning:
Comparison is base (
5aa1c36
) 67.44% compared to head (39a9794
) 67.44%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
I had to tweak it a bit since we await it via ensure_conncted as well and we don't want a timeout to cancel the inner.
This also fixes shutdown having to wait for the timeout because cancellation was ignored in the task
there are actually two time outs for the exact same time so there is another race here
nevermind, the other timeout is fine since its wrapping the ensure_connected
which goes into the background if it cannot connect. Its just confusing that they are the same
That background reconnect thing seemed like a good idea at the time (before async zeroconf etc). But if you feel it's adding complexity, maybe we could get rid. Polling will naturally retry, zeroconf updates should trigger a retry also. And we could add zeroconf s# support (if it's present and not hardcodes to 1 then it seems to work like BLE) to trigger reconnects.
There is also another race here since the add callback done is delivered via a call_soon so we only see it on the next iteration which means it can set the task to none when it's already started a new one
I think the background reconnect is still needed for users with unreliable mdns
We get zeroconf tickets all the time where one of their repeaters stops forwarding multicast but unicast still works
I did a bit of chaos testing with this by having a smart plug turn off a homekit smart plug every 90 seconds and while the homekit plug is flipping on/off every second from HA
Everything works now with no reconnect failures
related issue https://github.com/home-assistant/core/issues/93213