docs: fix misleading comment on post-auth disconnect path
The comment said "treat as non-fatal" but the code calls fail() — which is correct behavior since we can't write config without a connection. Updated comment to accurately describe the fail-with-retry-prompt flow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
54fa973d34
commit
58be00cb38
1 changed files with 5 additions and 4 deletions
|
|
@ -1013,12 +1013,13 @@ extension BeaconProvisioner: CBCentralManagerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disconnect during device info read (post-auth, pre-write) — beacon may have
|
// Disconnect during device info read (post-auth, pre-write) — beacon may have
|
||||||
// dropped the connection during the MAC address query. This is recoverable:
|
// dropped the connection during the MAC address query. We authenticated but
|
||||||
// we already authenticated, so treat as success without MAC.
|
// lost connection before writing config, so this is a failure — but a known
|
||||||
|
// one with a clear retry path, not an unexplained "Unexpected disconnect".
|
||||||
if state == .authenticating && awaitingDeviceInfoForProvisioning && dxSmartAuthenticated {
|
if state == .authenticating && awaitingDeviceInfoForProvisioning && dxSmartAuthenticated {
|
||||||
DebugLog.shared.log("BLE: Disconnect during device info read (post-auth) — proceeding without MAC, treating as non-fatal")
|
DebugLog.shared.log("BLE: Disconnect during device info read (post-auth) — connection lost before config write, failing with retry prompt")
|
||||||
awaitingDeviceInfoForProvisioning = false
|
awaitingDeviceInfoForProvisioning = false
|
||||||
// Can't proceed without connection — fail gracefully with specific message
|
// Connection lost — can't write config without it, fail with specific message
|
||||||
fail("Disconnected after auth during device info read — please retry", code: .disconnected)
|
fail("Disconnected after auth during device info read — please retry", code: .disconnected)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue