Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop storing two copies of attribute/event data in MTRDevice.
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.
bzbarsky-apple committed Apr 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b187c3e commit 061bac1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
@@ -609,14 +609,13 @@ - (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);

0 comments on commit 061bac1

Please sign in to comment.