Skip to content

Commit 4088a77

Browse files
Go back to using the storage key 1.0 used for group fabric info. (#24163)
#23409 changed the key under which we store group fabric info, which breaks reception of group messages if a node updates from before that change to after that change. We should just keep using the same key name, especially because sharing a single storage key for all possible fabric lists (groups and whatever else will want to store lists of fabric indices) does not necessarily make sense. Fixes #24161
1 parent e101730 commit 4088a77

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/credentials/GroupDataProviderImpl.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ using GroupEndpoint = GroupDataProvider::GroupEndpoint;
3333
using EpochKey = GroupDataProvider::EpochKey;
3434
using KeySet = GroupDataProvider::KeySet;
3535
using GroupSession = GroupDataProvider::GroupSession;
36-
using FabricList = CommonPersistentData::FabricList;
36+
37+
struct FabricList : public CommonPersistentData::FabricList
38+
{
39+
CHIP_ERROR UpdateKey(StorageKeyName & key) override
40+
{
41+
key = DefaultStorageKeyAllocator::GroupFabricList();
42+
return CHIP_NO_ERROR;
43+
}
44+
};
3745

3846
constexpr size_t kPersistentBufferMax = 128;
3947

src/lib/support/CommonPersistentData.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ struct StoredDataList : public PersistentData<kMaxSerializedSize>
7676
constexpr size_t kPersistentFabricBufferMax = 32;
7777
struct FabricList : StoredDataList<FabricIndex, kPersistentFabricBufferMax>
7878
{
79-
CHIP_ERROR UpdateKey(StorageKeyName & key) override
80-
{
81-
key = DefaultStorageKeyAllocator::FabricList();
82-
return CHIP_NO_ERROR;
83-
}
79+
// Subclasses need to define UpdateKey to be whatever fabric list key they
80+
// care about.
8481

8582
void Clear() override
8683
{

src/lib/support/DefaultStorageKeyAllocator.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ class DefaultStorageKeyAllocator
102102
static StorageKeyName FabricMetadata(FabricIndex fabric) { return StorageKeyName::Formatted("f/%x/m", fabric); }
103103
static StorageKeyName FabricOpKey(FabricIndex fabric) { return StorageKeyName::Formatted("f/%x/o", fabric); }
104104

105-
// Fabric List
106-
static StorageKeyName FabricList() { return StorageKeyName::FromConst("g/fl"); }
107-
108105
// Fail-safe handling
109106
static StorageKeyName FailSafeCommitMarkerKey() { return StorageKeyName::FromConst("g/fs/c"); }
110107
static StorageKeyName FailSafeNetworkConfig() { return StorageKeyName::FromConst("g/fs/n"); }
@@ -147,6 +144,7 @@ class DefaultStorageKeyAllocator
147144
// Group Data Provider
148145

149146
// List of fabric indices that have endpoint-to-group associations defined.
147+
static StorageKeyName GroupFabricList() { return StorageKeyName::FromConst("g/gfl"); }
150148
static StorageKeyName FabricGroups(chip::FabricIndex fabric) { return StorageKeyName::Formatted("f/%x/g", fabric); }
151149
static StorageKeyName FabricGroup(chip::FabricIndex fabric, chip::GroupId group)
152150
{

0 commit comments

Comments
 (0)