Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pairing Delegates get repeated calls to OnPairingComplete #18230

Closed
sagar-apple opened this issue May 9, 2022 · 0 comments · Fixed by #18524
Closed

Pairing Delegates get repeated calls to OnPairingComplete #18230

sagar-apple opened this issue May 9, 2022 · 0 comments · Fixed by #18524

Comments

@sagar-apple
Copy link
Contributor

Problem

Setup: Once a device is commissioned and a CASE session is established.
If first message for a command fails to deliver, the CHIPDeviceController calls, updateDevice which then goes and calls OnPairingComplete even though we are not currently commissioning.

See CHIPDeviceController.cpp

void DeviceController::OnFirstMessageDeliveryFailed(const SessionHandle & session)
...
    err = UpdateDevice(secureSession->GetPeerNodeId());

Proposed Solution

We need to define what OnPairingComplete actually means. My understanding is that it means PASE is established. In which case, it has no meaning once Commissioning is complete and shouldn't keep getting triggered.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue May 17, 2022
OnPairingComplete is documented as indicating the end of PASE
establishment, but our implementation calls it for _some_ CASE
sessions as well: only the ones we kick off from UpdateDevice.

This is unexpected by API consumers, and we should not be doing it.

Fixes project-chip#18230
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue May 17, 2022
OnPairingComplete is documented as indicating the end of PASE
establishment, but our implementation calls it for _some_ CASE
sessions as well: only the ones we kick off from UpdateDevice.

This is unexpected by API consumers, and we should not be doing it.

Fixes project-chip#18230
andy31415 pushed a commit that referenced this issue May 18, 2022
* Stop calling OnPairingComplete on CASE session establishment.

OnPairingComplete is documented as indicating the end of PASE
establishment, but our implementation calls it for _some_ CASE
sessions as well: only the ones we kick off from UpdateDevice.

This is unexpected by API consumers, and we should not be doing it.

Fixes #18230

* Address review comments.

* Stop calling UpdateDevice from the Python controller.

Use GetConnectedDevice instead, so we don't have to rely on global callbacks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant