Skip to content

Commit

Permalink
Store the PairedDeviceList as soon as a New Device is added (#6507)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-apple authored and pull[bot] committed Aug 23, 2021
1 parent 55a158c commit 2289749
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,12 @@ void DeviceCommissioner::OnSessionEstablished()
mPairedDevices.Insert(device->GetDeviceId());
mPairedDevicesUpdated = true;

// Note - This assumes storage is synchronous, the device must be in storage before we can cleanup
// the rendezvous session and mark pairing success
PersistDevice(device);
// Also persist the device list at this time
// This makes sure that a newly added device is immediately available
PersistDeviceList();

if (mPairingDelegate != nullptr)
{
Expand Down

0 comments on commit 2289749

Please sign in to comment.