project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.43k stars 1.99k forks source link

Need clarity on requirements and design of AdvertiseOperational() API #8909

Open pan-apple opened 3 years ago

pan-apple commented 3 years ago

Problem

The API is being called when the device get provisioned with new operational certificates (via AddNOC or UpdateNOC) commands. However, it's not clear how long the API is supposed to take during the synchronous part of the operation. Given, the API could have multiple implementations, for different platforms, it's important to document the timing requirements, and expected design. Based on that the call to AdvertiseOperational could be moved to the more appropriate part of the code.

Reference: https://github.com/project-chip/connectedhomeip/pull/8826#discussion_r686973301

bzbarsky-apple commented 3 years ago

@andreilitvin @cecille

andy31415 commented 3 years ago

Add as a comment. I believe that 'Advertise' should be 'initiate advertising' and will do any calculation inline that it can (all name and property calculation) however if something is significantly blocking, it would be deferred async to not make 'advertise' block.

I am thinking of these potential blocking operations:

bzbarsky-apple commented 3 years ago

Do we need to block until 'advertisement is officially done/available'

Not at all. Ideally we would do the advertisement completely in the background or something... and definitely in parallel with sending the "we succeeded" response to the caller.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.