Skip to content

Commit

Permalink
Apply review follow-ups of PR #19819 on FabricTable (#19970)
Browse files Browse the repository at this point in the history
* Don't notify attribute changes on commit

* Apply follow-up comments from @bzbarsky-apple, all style/nits

* Simplify AddOrUpdateInner from @msandstedt comment

* Restyled

* Fix comment editorials from @bzbarsky-apple

* Add test for AddNOC fail-safe handling

* Add test for UpdateNOC failsafe handling

* Fix #19819 (comment)

* Add Persistence Unit test

* Restyled

* Update src/credentials/FabricTable.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Fix CI

* Restyled

Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jul 6, 2022
1 parent 023749a commit dc3dde7
Show file tree
Hide file tree
Showing 5 changed files with 953 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ class OpCredsFabricTableDelegate : public chip::FabricTable::Delegate
NotifyFabricTableChanged();
}

// Gets called when a fabric is added/updated, but not necessarily committed to storage
void OnFabricUpdated(const FabricTable & fabricTable, FabricIndex fabricIndex) override { NotifyFabricTableChanged(); }

// Gets called when a fabric in FabricTable is persisted to storage
Expand All @@ -412,12 +413,10 @@ class OpCredsFabricTableDelegate : public chip::FabricTable::Delegate
VerifyOrReturn(fabric != nullptr);

ChipLogProgress(Zcl,
"OpCreds: Fabric index 0x%x was committed to storage. Compressed Fabric Id 0x" ChipLogFormatX64
"OpCreds: Fabric index 0x%x was committed to storage. Compressed Fabric Id 0x" ChipLogFormatX64
", FabricId " ChipLogFormatX64 ", NodeId " ChipLogFormatX64 ", VendorId 0x%04X",
static_cast<unsigned>(fabric->GetFabricIndex()), ChipLogValueX64(fabric->GetCompressedFabricId()),
ChipLogValueX64(fabric->GetFabricId()), ChipLogValueX64(fabric->GetNodeId()), fabric->GetVendorId());

NotifyFabricTableChanged();
}

private:
Expand Down
Loading

0 comments on commit dc3dde7

Please sign in to comment.