Re: [presentation-api] Refine how to do session teardown/disconnect/closing

First, let's assume we adopt the both a `terminated` and `closed` 
states per the resolution in  
https://github.com/w3c/presentation-api/issues/35#issuecomment-103515810.
  I walked through some scenarios in how the current API could behave.

- Controlling page calls `session.close()`:
  - session transitions to terminated
  - Presentation is closed
  - Other controlling sessions connected to the presentation also 
transition to terminated or closed. This depends on whether there was 
a definitive signal from the presentation that it was intentionally 
closed, or if it abruptly disconnects sessions at the network level.
- Presented page is closed (by itself, by user agent, by user)
  - All controlling sessions transition to terminated
- Controlling session is disconnected from presentation accidentally 
(e.g. user changes WiFi networks away from TV)
  - Controlling session transitions to closed
  - Corresponding session on the presentation also transitions to 
closed
  - Presentation continues to run
  - Controlling page may want to offer "reconnect" as an option to the
 user to resume connection via join().
- Last controlling session disconnects from presentation 
  - Presentation will see that all sessions are in the closed state.  
It can close itself with window.close() it if wants to, or wait for 
new connections.
- Controlling session wishes to leave the presentation (without 
terminating it).
  - This case is not handled by the API.
  - The controlling page could discard the session, which could cause 
the corresponding session on the presenting page to transition to 
closed.   This would need to be spelled out.
  - Or we could add a specific session.disconnect() method.

We are overloading the meaning of the state a little bit.  It can mean
 the state of the presentation (terminated or running).  It can also 
mean the state of a single connection between a controlling page and 
the presentation (closed or not).  I don't think these are 
inconsistent according to the cases above however.













-- 
GitHub Notif of comment by mfoltzgoogle
See 
https://github.com/w3c/presentation-api/issues/35#issuecomment-130123783

Received on Wednesday, 12 August 2015 00:45:38 UTC