{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/encrypted-media/issues/180","repository_url":"https://api.github.com/repos/w3c/encrypted-media","labels_url":"https://api.github.com/repos/w3c/encrypted-media/issues/180/labels{/name}","comments_url":"https://api.github.com/repos/w3c/encrypted-media/issues/180/comments","events_url":"https://api.github.com/repos/w3c/encrypted-media/issues/180/events","html_url":"https://github.com/w3c/encrypted-media/issues/180","id":153351944,"number":180,"title":"\"persistent-usage-record\" sessions should not be handled in remove()","user":{"login":"ddorwin","id":9738764,"avatar_url":"https://avatars.githubusercontent.com/u/9738764?v=3","gravatar_id":"","url":"https://api.github.com/users/ddorwin","html_url":"https://github.com/ddorwin","followers_url":"https://api.github.com/users/ddorwin/followers","following_url":"https://api.github.com/users/ddorwin/following{/other_user}","gists_url":"https://api.github.com/users/ddorwin/gists{/gist_id}","starred_url":"https://api.github.com/users/ddorwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddorwin/subscriptions","organizations_url":"https://api.github.com/users/ddorwin/orgs","repos_url":"https://api.github.com/users/ddorwin/repos","events_url":"https://api.github.com/users/ddorwin/events{/privacy}","received_events_url":"https://api.github.com/users/ddorwin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/w3c/encrypted-media/labels/needs%20implementation","name":"needs implementation","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"mwatson2","id":7593867,"avatar_url":"https://avatars.githubusercontent.com/u/7593867?v=3","gravatar_id":"","url":"https://api.github.com/users/mwatson2","html_url":"https://github.com/mwatson2","followers_url":"https://api.github.com/users/mwatson2/followers","following_url":"https://api.github.com/users/mwatson2/following{/other_user}","gists_url":"https://api.github.com/users/mwatson2/gists{/gist_id}","starred_url":"https://api.github.com/users/mwatson2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwatson2/subscriptions","organizations_url":"https://api.github.com/users/mwatson2/orgs","repos_url":"https://api.github.com/users/mwatson2/repos","events_url":"https://api.github.com/users/mwatson2/events{/privacy}","received_events_url":"https://api.github.com/users/mwatson2/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/w3c/encrypted-media/milestones/1","html_url":"https://github.com/w3c/encrypted-media/milestones/V1","labels_url":"https://api.github.com/repos/w3c/encrypted-media/milestones/1/labels","id":1356261,"number":1,"title":"V1","description":"Those issues are substantive for V1. Some may get moved to V.Next if not done by June 9th.\r\n","creator":{"login":"jdsmith3000","id":8323871,"avatar_url":"https://avatars.githubusercontent.com/u/8323871?v=3","gravatar_id":"","url":"https://api.github.com/users/jdsmith3000","html_url":"https://github.com/jdsmith3000","followers_url":"https://api.github.com/users/jdsmith3000/followers","following_url":"https://api.github.com/users/jdsmith3000/following{/other_user}","gists_url":"https://api.github.com/users/jdsmith3000/gists{/gist_id}","starred_url":"https://api.github.com/users/jdsmith3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdsmith3000/subscriptions","organizations_url":"https://api.github.com/users/jdsmith3000/orgs","repos_url":"https://api.github.com/users/jdsmith3000/repos","events_url":"https://api.github.com/users/jdsmith3000/events{/privacy}","received_events_url":"https://api.github.com/users/jdsmith3000/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":56,"state":"open","created_at":"2015-10-14T21:50:00Z","updated_at":"2016-05-31T12:52:51Z","due_on":"2016-06-09T04:00:00Z","closed_at":null},"comments":10,"created_at":"2016-05-05T23:58:52Z","updated_at":"2016-05-31T14:23:38Z","closed_at":null,"body":"For most (\"happy case\") `\"persistent-usage-record\"` sessions, it will be irrelevant whether usage data was persisted. (Conceptually, from the application's point of view, the record is only stored if it was not handled and cleared during the application’s lifetime.) Thus, applications may find it confusing to call `remove()` when they have not explicitly persisted something. Additionally, unlike `\"persistent-license\"` sessions, `remove()` never actually _removes_ anything for  `\"persistent-usage-record\"` sessions. (`update()` removes the relevant record for both types of sessions.)\r\n\r\nPulling `\"persistent-usage-record\"` out of the `remove()` algorithm will focus it on removing (destroying) persisted license(s) and keys(s). (Currently, this is applicable only to `\"persistent-license\"` sessions. In-memory keys are destroyed when a session is closed, so there is no reason to cover those in this method.) This would make resolving #155 much more straightforward.\r\n\r\n\r\n<br/>Let’s take a look at what `remove()` currently does for `\"persistent-usage-record\"` sessions. Currently, it destroys the keys, persists the _record of key usage_, and generates a message.\r\n\r\nAs the discussion in Issue #171 and related PRs has helped highlight, there are multiple paths to closing sessions and the resulting actions of destroying ephemeral keys and storing the _record of key usage_ for `\"persistent-usage-record\"` sessions. This seems to make handling this session type in `remove()` redundant except for the queuing of a message. (The in-memory keys are destroyed and the _record of key usage_ is persisted in both cases.)\r\n\r\nThe session closing paths do not currently perform two operations:\r\n\r\n1. Generating a release message when the session is closed.\r\n1. Generating a message for a loaded session containing a persisted record of key usage.\r\n * This is for the \"unhappy case\" where the first message was not sent and/or ACK’d.\r\n * Note that in this case the keys are unnecessarily destroyed (there aren’t any) and the _record of key usage_ is re-stored.\r\n\r\nIs there a reason (1) shouldn’t be performed by `close()` (or any other reason the session is closed)?\r\n\r\nI see three ways that (2) could be handled. In order of preference:\r\n\r\n* `close()` always generates a message for the _record of key usage_, which would have been loaded into the session by `load()`.\r\n - This seems the most consistent from an application point of view.\r\n - The loaded sessions is the same as an active session except there are no keys.\r\n* `load()` generates the message, which is something the algorithm already allows.\r\n - We can add normative steps for this session type there\r\n* `remove()` only generates messages in case (2).\r\n - This seems inconsistent and makes it hard to define the purpose of `remove()` (see #155).\r\n\r\nNote: The loading of `\"persistent-usage-record\"` sessions and correct behavior of the `remove()` algorithm currently greatly depends on the definition of [Known Key](https://w3c.github.io/encrypted-media/#known-key) and understanding that a record of key usage was persisted. Even so, I’m not sure there is any language indicating the new session’s _record of key usage_ is actually populated with the stored data.\r\n"},"comment":{"url":"https://api.github.com/repos/w3c/encrypted-media/issues/comments/222704295","html_url":"https://github.com/w3c/encrypted-media/issues/180#issuecomment-222704295","issue_url":"https://api.github.com/repos/w3c/encrypted-media/issues/180","id":222704295,"user":{"login":"mwatson2","id":7593867,"avatar_url":"https://avatars.githubusercontent.com/u/7593867?v=3","gravatar_id":"","url":"https://api.github.com/users/mwatson2","html_url":"https://github.com/mwatson2","followers_url":"https://api.github.com/users/mwatson2/followers","following_url":"https://api.github.com/users/mwatson2/following{/other_user}","gists_url":"https://api.github.com/users/mwatson2/gists{/gist_id}","starred_url":"https://api.github.com/users/mwatson2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwatson2/subscriptions","organizations_url":"https://api.github.com/users/mwatson2/orgs","repos_url":"https://api.github.com/users/mwatson2/repos","events_url":"https://api.github.com/users/mwatson2/events{/privacy}","received_events_url":"https://api.github.com/users/mwatson2/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T14:23:38Z","updated_at":"2016-05-31T14:23:38Z","body":"Pull Request #208 "}}
{"actor":{"display_login":"mwatson2"}}