You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Darwin] MTRDevice subscription estalished handler should change state before async (#34797)
* [Darwin] MTRDevice subscription estalished handler should change state before async
* Update src/darwin/Framework/CHIP/MTRDevice.mm
Co-authored-by: Kiel Oleson <kielo@apple.com>
* Addressed PR review - moved code comment to correct place
---------
Co-authored-by: Kiel Oleson <kielo@apple.com>
// If subscription had reset since this handler was scheduled, do not execute "established" logic below
1197
+
if (!HaveSubscriptionEstablishedRightNow(_internalDeviceState)) {
1198
+
MTR_LOG("%@ _handleSubscriptionEstablished run with internal state %lu - skipping subscription establishment logic", self, static_cast<unsigned long>(_internalDeviceState));
1199
+
return;
1206
1200
}
1207
1201
1208
-
[self _changeState:MTRDeviceStateReachable];
1202
+
// We have completed the subscription work - remove from the subscription pool.
1203
+
[self _clearSubscriptionPoolWork];
1209
1204
1210
1205
// No need to monitor connectivity after subscription establishment
1211
1206
[self _stopConnectivityMonitoring];
1212
1207
1208
+
// reset subscription attempt wait time when subscription succeeds
1209
+
_lastSubscriptionAttemptWait = 0;
1210
+
1213
1211
auto initialSubscribeStart = _initialSubscribeStart;
1214
1212
// We no longer need to track subscribe latency for this device.
0 commit comments