-
Notifications
You must be signed in to change notification settings - Fork 53
fix(cddl): fix CDDL syntax for emulation.SetGeolocationOverrideParameters
#914
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
Open
christian-bromann
wants to merge
6
commits into
main
Choose a base branch
from
cb/geolocation-cddl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
587cd8c
fix(cddl): fix CDDL syntax for emulation.SetGeolocationOverrideParame…
christian-bromann bcfbc4b
fix group syntax
christian-bromann 3d8a8f8
align with extensibility idiom
christian-bromann 8d2eefc
PR feedback
christian-bromann 72060f6
add type parameter
christian-bromann 82b7005
PR feedback
christian-bromann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
AFAICS this can stay as a map, or do I miss something?
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.
Right, I think this should stay a map
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.
While it is possible to insert a group into a map, e.g.:
It is not possible to include group choices, because the map expects a single group, not a group choice expression*.
RFC 8610 (Section 3.5) says:
But that refers to a group, not a group choice. Group choices (
//
) are only valid inside a group.Uh oh!
There was an error while loading. Please reload this page.
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.
(emulation.SetGeolocationPosition // emulation.GeolocationPositionError)
defines a new group (due to()
) so it is valid to put it into a map. We have other places where this works. The current PR version does provide any type for the params key.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.
@OrKoN it is not allowed to have a group choice (
//
) between two maps ({ ... }
). This aligns with other places in the spec, e.g.(browser.ClientWindowNamedState // browser.ClientWindowRectState)
(ref) where bothbrowser.ClientWindowNamedState
andbrowser.ClientWindowRectState
are groups (( ... )
)(network.ContinueWithAuthCredentials // network.ContinueWithAuthNoCredentials)
(ref) where also bothnetwork.ContinueWithAuthCredentials
andnetwork.ContinueWithAuthNoCredentials
are groupsThe CDDL specification indirectly defines this in RFC 8610 §3.9 — Group-to-Group Composition:
This means:
A // B
is only valid if both A and B are groups.{ ... }
) is a type, not a group, and therefore cannot be used directly in//
.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.
Sorry, I am not following: both SetGeolocationPosition and GeolocationPositionError are groups, not maps. SetGeolocationOverrideParameters has to remain a map: