-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix error for minimal mDNS and commissioner discovery on TV's. #7397
Conversation
What's the failure? Why does it happen? |
@chrisdecenzo removed those API calls in this PR https://github.com/project-chip/connectedhomeip/pull/6298/files#diff-5d7e3705190aa2e6b56687bd55d965a4cf12f22ed6fe28e760202e4759d41c56L294. Had a discussion with him he mentioned that it leads to failure in case of commissioner discovery on TV's, and suggested the appropriate changes. |
Not sure about TVs, just having the clear in the Advertise call means we clear out operational records when we start commissioning and vice-versa. For now, this is fine, because we haven't started multi-admin scenarios yet. operational and commissioning together need a few more tweaks anyway to keep them separated from each other. I'm good with either method. |
@chrisdecenzo Can you please take a look at this? |
/rebase |
4181469
to
d0c23a2
Compare
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really like a clear explanation of what this change is doing and why it's needed. My attempt to look at history here seems to show that we had the Clear()
calls in Advertise()
, then they were removed in PR #6298 with no explanation, then PR #7356 put them back. Now this PR is removing them again, but adding the call in Start
.
We should stop having an "edit war" here, and it seems to me that the way to do that is to add documentation at the places that should be calling Clear
explaining why they are doing it and to add documentation at the places that should not be calling Clear
explaining why they are not doing it. And that latter explanation needs to cover exactly what goes wrong if you call Clear
there.
Would it be possible to add such comments?
The Clear() method is added to Start() as recommended but was also added back to the Advertise() methods which will be a problem on some devices. |
Thank you. That is much clearer. Can that please go in a comment in the code? So in the |
eeea9c5
to
b5b0a25
Compare
* Clear() method should not be called in Advertise() | ||
* because for the devices which call Advertise() method more than 1 times i.e. advertise operational, commissionable, and | ||
* commissioner needs the result to be additive. If Clear() is called at the beginning of these Advertise methods, then only the | ||
* last call to Advertise will take effect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Clear() method should not be called in Advertise() | |
* because for the devices which call Advertise() method more than 1 times i.e. advertise operational, commissionable, and | |
* commissioner needs the result to be additive. If Clear() is called at the beginning of these Advertise methods, then only the | |
* last call to Advertise will take effect. | |
* Clear() should not be called in Advertise() because some devices want to advertise | |
* multiple things (operational advertisement, commissionable advertisement, commissioner | |
* advertisement). If Clear() were called at the beginning of these Advertise methods, then | |
* only the last call to Advertise would take effect. |
* Clear() method should not be called in Advertise() | ||
* because for the devices which call Advertise() method more than 1 times i.e. advertise operational, commissionable, and | ||
* commissioner needs the result to be additive. If Clear() is called at the beginning of these Advertise methods, then only the | ||
* last call to Advertise will take effect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Clear() method should not be called in Advertise() | |
* because for the devices which call Advertise() method more than 1 times i.e. advertise operational, commissionable, and | |
* commissioner needs the result to be additive. If Clear() is called at the beginning of these Advertise methods, then only the | |
* last call to Advertise will take effect. | |
* Clear() should not be called in Advertise() because some devices want to advertise | |
* multiple things (operational advertisement, commissionable advertisement, commissioner | |
* advertisement). If Clear() were called at the beginning of these Advertise methods, then | |
* only the last call to Advertise would take effect.``` |
@sweetymhaiske Please note the unresolved review comments (that used to be resolved until the latest update was pushed). |
Size increase report for "nrfconnect-example-build" from 7124079
Full report output
|
|
Problem
Clear()
call in Advertising API, will lead to failure of commissioner discovery on TV's.Change overview
Made the appropriate call to
Clear()
API.Testing