@@ -484,8 +484,12 @@ 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.
488
487
VerifyOrDie (mpImEngine->InActiveReadClientList (this ));
488
+
489
+ // Note: this API only works when issuing subscription via SendAutoResubscribeRequest, when SendAutoResubscribeRequest is
490
+ // called, either mEventPathParamsListSize or mAttributePathParamsListSize is not 0.
491
+ VerifyOrDie (mReadPrepareParams .mEventPathParamsListSize != 0 || mReadPrepareParams .mAttributePathParamsListSize != 0 );
492
+
489
493
// When we reach here, the subscription definitely exceeded the liveness timeout. Just continue the unfinished resubscription
490
494
// logic in `OnLivenessTimeoutCallback`.
491
495
if (IsInactiveICDSubscription ())
@@ -494,18 +498,19 @@ void ReadClient::OnActiveModeNotification()
494
498
return ;
495
499
}
496
500
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.
501
+ // If the server sends out check-in message, and there is no reschedule subscription yet in client side at the same time, it
502
+ // means current client does not realize subscription has gone, and we should forcibly timeout current subscription, and
503
+ // schedule a new one.
499
504
if (!mIsResubscriptionScheduled )
500
505
{
501
- // Closing will ultimately trigger ScheduleResubscription with the aReestablishCASE argument set to true, effectively
506
+ // Closing will ultimately trigger ScheduleResubscription with the aReestablishCASE argument set to true, effectively
502
507
// rendering the session defunct.
503
508
Close (CHIP_ERROR_TIMEOUT);
504
509
return ;
505
510
}
506
511
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.
512
+ // If the server sends a check-in message and a subscription is already scheduled, it indicates a client-side subscription
513
+ // timeout or failure. Cancel the scheduled subscription and initiate a new one immediately.
509
514
TriggerResubscribeIfScheduled (" check-in message" );
510
515
}
511
516
0 commit comments