fix(mqtt): stale observed refs BadNoCommunication on connection loss so the identical replay recovers (05/STAB-18 shape a)

This commit is contained in:
Joseph Doherty
2026-08-20 09:46:56 -04:00
parent 7af9baab39
commit ac2f8dc801
6 changed files with 256 additions and 1 deletions
@@ -608,3 +608,13 @@ test could only pass once the production change landed.
nothing at all for an already-observed ref.
- GREEN: 77 `MqttSubscriptionManager*` tests pass, incl. the suppression control (an identical message
after the push is still swallowed). Full `Driver.Mqtt.Tests`: 790/790.
### T3 — `MqttConnection.ConnectionLost` + plain-mode stale
- RED: `--filter "…MqttSubscriptionManagerRecoveryTests|…ConnectionLost"` ⇒ **build failure**,
`CS1061: 'MqttSubscriptionManager' does not contain a definition for 'OnConnectionLost'` (×5) and
`CS1061: 'MqttConnection' does not contain a definition for 'ConnectionLost'` (×3).
- GREEN: 11/11 (8 manager recovery + 3 connection edge). Full `Driver.Mqtt.Tests`: 797/797.
- The event fires inside the existing `State == Connected` guard in `OnDisconnectedAsync`, which is
what makes "not on an initial-connect failure" and "not on dispose" true by construction rather
than by a second condition — `DisposeAsync` sets `Disposed` before tearing the client down.
@@ -17,7 +17,7 @@
{
"id": "T3",
"subject": "MqttConnection.ConnectionLost event + plain-mode stale observed refs to BadNoCommunication (value retained) so the identical replay recovers (05/STAB-18 shape a)",
"status": "pending",
"status": "done",
"blockedBy": [
"T2"
]