connectedhomeip icon indicating copy to clipboard operation
connectedhomeip copied to clipboard

Subscription id handling in interaction model is pretty broken

Open bzbarsky-apple opened this issue 2 years ago • 0 comments

Problem

Subscription ids are assigned by the server and are scoped to that server. That means that two different subscriptions can have the same id on the client, if they are targeting different servers. So subscription id is not a unique identifier on the client.

Given that, we use subscription ids on the client in the following broken ways:

  1. InteractionModelEngine::ShutdownSubscription uses the subscription id as a unique key to shut down a specific subscription. I don't know how to fix this one.
  2. InteractionModelEngine::OnUnsolicitedReportData uses the subscription id as a unique key to find the right ReadClient. At least for this one we could easily check the fabric index and node id of the peer....

bzbarsky-apple avatar Aug 03 '22 16:08 bzbarsky-apple

The spec-related problem has been fixed in #21771 so I'm going to remove that label. The remaining issue is limited to ShutdownSubscription, of which there is only one consumer, i.e chip-tool command.

I'm not sure if there are any cert tests that rely on this command. If they do, we should attach the "cert blocker" on this.

mrjerryjohns avatar Aug 12 '22 16:08 mrjerryjohns