Skip to content

Commit

Permalink
Stop storing two copies of attribute/event data in MTRDevice. (#26181)
Browse files Browse the repository at this point in the history
We have our own attribute value cache; we're just using ClusterStateCache to
track DataVersions and event numbers.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Aug 28, 2023
1 parent 11bbd62 commit 4601561
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,12 @@ - (void)_setupSubscription
});
});

// Set up a cluster state cache. We really just want this for the
// logic it has for tracking data versions and event numbers so we
// minimize the amount of data we request on resubscribes; we
// don't care about the data it stores. Ideally we could use the
// dataversion-management logic without needing to store the data
// separately from the data store we already have, or we would
// stop storing our data separately.
auto clusterStateCache = std::make_unique<ClusterStateCache>(*callback.get());
// Set up a cluster state cache. We just want this for the logic it has for
// tracking data versions and event numbers so we minimize the amount of data we
// request on resubscribes, so tell it not to store data.
auto clusterStateCache = std::make_unique<ClusterStateCache>(*callback.get(),
/* highestReceivedEventNumber = */ NullOptional,
/* cacheData = */ false);
auto readClient = std::make_unique<ReadClient>(InteractionModelEngine::GetInstance(), exchangeManager,
clusterStateCache->GetBufferedCallback(), ReadClient::InteractionType::Subscribe);

Expand Down

0 comments on commit 4601561

Please sign in to comment.