mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 02:51:29 +00:00
Restore the reconnect-during-teardown cancel fast path
The collapse of the CONNECTING branch dropped a real race fix: HA re-requesting a connect while a scheduled teardown was still pending used to cancel the teardown and let the in-flight open complete; without it the request was ignored and HA paid a teardown plus a fresh connect during exactly the reconnect churn this path sees most. cancel_gatt_disconnect() joins the contract: true only for a scheduled teardown that has not started closing (Bluedroid clears the latched want_disconnect_); rp2 and the stubs return false since their teardowns start inside gatt_disconnect(). The wrapper's cancel_teardown() returns its state to CONNECTING and the proxy handler carries the dev branch verbatim.
This commit is contained in:
@@ -31,6 +31,7 @@ class MinimalConnection {
|
||||
this->listener_->on_connection_state(true, 517, 0);
|
||||
return 0;
|
||||
}
|
||||
bool cancel_gatt_disconnect() { return false; }
|
||||
int gatt_disconnect() { return 0; }
|
||||
int discover_services() {
|
||||
this->listener_->on_service_discovery_done(0);
|
||||
|
||||
Reference in New Issue
Block a user