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

Add messages and protocol for Presentation API #120

Merged
merged 30 commits into from Dec 6, 2018

Conversation

pthatcherg
Copy link
Contributor

No description provided.

Copy link
Member

@tidoust tidoust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! See inline comments for typos.

I'd prefer to use the same conformance classes in this document as in the Presentation API, unless there's a good reason not to.

It would also be good to link things together properly, e.g. to add proper links to relevant sections in the Presentation API, and to link back terms to definitions, but that's typically something that can be done later on (and which I'd be happy to do)

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
tidoust and others added 12 commits November 12, 2018 12:55
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
@pthatcherg
Copy link
Contributor Author

I updated the terminology to use what I noticed was already in the "terminology" section at the start of the doc, which defines "controller" and "receiver" according to the terms in the API docs. So, I just used those shorter names everywhere.

I also added proper links to the API docs.

But I haven't yet learned how to do internal links in a markdown/bikeshed file (use HTML tags?). If you want to explain to me how to do that, I can add some internal links. Of course, if you're willing to do that later, I'd be happy to let you do it :).

@tidoust
Copy link
Member

tidoust commented Nov 13, 2018

But I haven't yet learned how to do internal links in a markdown/bikeshed file (use HTML tags?). If you want to explain to me how to do that, I can add some internal links. Of course, if you're willing to do that later, I'd be happy to let you do it :).

Relevant documentation is in the Definitions and Autolinking sections of Bikeshed's documentation. Essentially, you'll need to use <dfn> tags to define terms, and use [=toto=] to reference them from other parts of the spec. That should be enough in most cases.

Bikeshed does not know anything about CDDL, so it won't be able to auto-dfn relevant terms in CDDL definitions. It won't be able to do syntax highlighting on CDDL blocks either, actually (CDDL does not seem to be supported by Pygments, used under the hoods).

Again, I'm happy to handle these editorial updates afterwards, so that you can focus on the important bits, meaning the actual definition of the protocol and mapping!

@pthatcherg
Copy link
Contributor Author

OK, I split into 2 sections.

I'll take you up on your offer to add internal links. You can do so later, or you could make changes directly to my PR.

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
connections, thus making message demuxing/routing easier).


A controller may terminate a connection without terminating the presentation by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been wondering if, for both close and terminate, we should exclusively use an event. Is there any reason for the controller to wait for a close-response/termination-response? Is there anything it should do with an error in one of those responses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The receiver could refuse to terminate for some reason (maybe it decides the controller isn't allowed to terminate that presentation). The controller can't assume it happened until it receives the response. The presentation API doesn't allow for a close() or terminate() method to fail asynchronously, though. So if we wanted to allow the JS to do something, like indicate to the user that close/terminate failed, it wouldn't have a way of knowing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. close/terminate always creates a state change on the controller side. Since the controller can't assume it can communicate with the presentation (or the device it's on) after these are called, there's no way to communicate the outcome back to the JS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we change the close() method to return a Promise to resolve when the close is acked?

index.bs Outdated Show resolved Hide resolved
index.bs Show resolved Hide resolved
index.bs Show resolved Hide resolved
@tidoust
Copy link
Member

tidoust commented Dec 4, 2018

I'll take you up on your offer to add internal links. You can do so later, or you could make changes directly to my PR.

Deal! :) I propose to do it later, typically when pending PRs have been merged.

@chrisn
Copy link
Member

chrisn commented Dec 5, 2018

A minor note, I wanted to read the changes as rendered HTML, but converting the bikeshed to HTML produced a few errors relating to indentation. I'd be happy to fix these up, but don't want to introduce whitespace only changes. LMK if you'd like me to go ahead.

@pthatcherg
Copy link
Contributor Author

Sorry, I didn't bother to run bikeshed yet. I probably should. It would great if you wanted to fix that. Please, go ahead!

Copy link
Contributor

@mfoltzgoogle mfoltzgoogle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good - minor comments / suggested edits

index.bs Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Show resolved Hide resolved
index.bs Show resolved Hide resolved
; type key 14
presentation-url-availability-request = {
request
1: [* text] ; urls
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is an empty list valid here? Similar question for presentation-url-availability-event

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but the response would just be an empty list.

For the event, it would tell you nothing is available any more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would a controller ever want to send an empty list?

Is the empty list behavior for the event documented?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wouldn't want to send an empty list. There's no reason. The behavior would have to be to return a response with an empty list.

I just added a "must not be empty" to make it clear this must never happen.

index.bs Outdated Show resolved Hide resolved
pthatcherg and others added 4 commits December 5, 2018 18:17
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
Co-Authored-By: pthatcherg <pthatcherg@users.noreply.github.com>
@pthatcherg
Copy link
Contributor Author

This conversation/review has gotten complex enough that I'm having trouble tracking all of the things going on.

I think that we're close enough to being in a good state that we should merge the PR and then resolve anything unresolved with issues and or separate PRs.

What do you think?

Copy link
Contributor

@mfoltzgoogle mfoltzgoogle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to merge. Followup items can be handled in other PRs if you would like.

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 this pull request may close these issues.

None yet

5 participants