File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,7 @@ CHIP_ERROR ReadClient::GenerateDataVersionFilterList(DataVersionFilterIBs::Build
484
484
485
485
void ReadClient::OnActiveModeNotification ()
486
486
{
487
+ // Note: this API only works when issuing subscription via SendAutoResubscribeRequest.
487
488
VerifyOrDie (mpImEngine->InActiveReadClientList (this ));
488
489
// When we reach here, the subscription definitely exceeded the liveness timeout. Just continue the unfinished resubscription
489
490
// logic in `OnLivenessTimeoutCallback`.
@@ -493,6 +494,18 @@ void ReadClient::OnActiveModeNotification()
493
494
return ;
494
495
}
495
496
497
+ // If the server sends out check-in message, and there is no reschedule subscription yet in client side at the same time, it means
498
+ // current client does not realize subscription has gone, and we should forcibly timeout current subscription, and schedule a new one.
499
+ if (!mIsResubscriptionScheduled )
500
+ {
501
+ // Closing will ultimately trigger ScheduleResubscription with the aReestablishCASE argument set to true, effectively
502
+ // rendering the session defunct.
503
+ Close (CHIP_ERROR_TIMEOUT);
504
+ return ;
505
+ }
506
+
507
+ // If the server sends a check-in message and a subscription is already scheduled, it indicates a client-side subscription timeout or failure.
508
+ // Cancel the scheduled subscription and initiate a new one immediately.
496
509
TriggerResubscribeIfScheduled (" check-in message" );
497
510
}
498
511
You can’t perform that action at this time.
0 commit comments