Re: [presentation-api] Define return value for cancelled/missing session for startSession/joinSession

An unresolved promise would protect the user's privacy, as it does not
 disclose the fact the user actively dismisses the screen picker UI.

As a drawback, that'd  make it impossible for the script to know 
`startSession()` invocation failed without resorting to hacks such as 
an expiring timer that checks for the existence of a session (and this
 given no reason, obviously).

A use case that would benefit from an explicit rejection, and 
optionally its reason:

1. A site, say FooTube, uses the Presentation API to show some of its 
content on a second screen.
2. The user clicks "Show on my big screen" button.
3. The user disallows the request or an error occurs in establishing 
the session.
4. The site provides a fallback UX tailored for the site that provides
 the user instructions on how to resolve the issue, optionally with a 
reason why the request failed.

Alternative approach is to leave all the fallback UX to the UA to 
address, let the UA inform the user of errors, provide instructs on 
how to resolve if an error occurs, and not inform the script of 
rejection (leave the promise unresolved).

With that, I'm wondering if the spec should leave some room for UAs to
 innovate, to be able to provide a UI from which the user can:
* Allow - promise resolved with a session
* Block - promise rejected with a reason
* Dismiss - promise unresolved

"Dismiss" might map to e.g. clicking [x] or "Cancel" button to close 
the dialog, while "Allow" and "Block" would be more explicit actions, 
such as buttons. Naturally, the spec will not mandate any specific UI 
style, and as long as the requests are asynchronous to not block the 
main thread we'd be good.

@avayvod - is there something to be learned from your implementation 
experiences since the issue was opened?

All - WDYT?

-- 
GitHub Notif of comment by anssiko
See 
https://github.com/w3c/presentation-api/issues/20#issuecomment-73664096

Received on Tuesday, 10 February 2015 08:50:39 UTC