-
Notifications
You must be signed in to change notification settings - Fork 185
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
Throw an InvalidStateError when an invalid attribute is used. #272
Conversation
c87a0dc
to
f6106e9
Compare
</li> | ||
</ol> | ||
</li> | ||
<li> | ||
Let <var>changedServices</var> be a set of <a>Service</a>s, initially empty. | ||
</li> | ||
<li> |
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.
In step 4 it says:
If attribute [...] appears in both, [...] remove it from both.
But in step 8 it says:
If service [...] appears in both remove it from both and add it to
changedServices
.
Maybe I'm missing something but wouldn't step 4 remove all services that step 8 would have added to changedServices
?
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.
Step 4 intends to remove attributes whose only changes are in their values. "with the same definition" may not be clear enough about this.
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.
Ah right. Though, Step 2 says to use
Primary Service Discovery, Relationship Discovery, Characteristic Discovery, and Characteristic Descriptor Discovery procedures
None of those procedures reads the values of the Characteristics or Descriptors. If I understand correctly you only get the Value Handles.
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.
If you have a service like:
Before:
- Service A:
- Characteristic B
After:
- Service A:
- Characteristic C
Then step 4 doesn't remove Service A from removedAttributes or addedAttributes since it has a different definition (the list of included services and characteristics is part of a service definition per 3.G.3.1), step 8 does remove it, and I believe no other step would remove it.
I think Included Services force step 8 to include the "add it to changedServices." bit. For Characteristics, I think step 9 would cover it.
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.
Ah I see. Then yeah I think a link to what it means to have the same definition would make things clearer. But also not related to this patch so OK to do in follow up
f6106e9
to
1f899d0
Compare
lgtm |
1f899d0
to
001c3a8
Compare
Did you mean to merge instead of closing? |
SG. Could you rebase the other pull request? |
Done. |
Preview at https://api.csswg.org/bikeshed/?url=https://raw.githubusercontent.com/jyasskin/web-bluetooth-1/invalidated-attributes/index.bs.
This fixes #130.