{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/normandy/pulls/comments/87113841","pull_request_review_id":7738985,"id":87113841,"diff_hunk":"@@ -2,27 +2,44 @@ import uuid from 'node-uuid';\n \n import Mozilla from './uitour.js';\n \n+export const STORAGE_DURABILITY_KEY = '_storageDurability';\n+\n /**\n  * Storage class that uses window.localStorage as it's backing store.\n  */\n-class LocalStorage {\n+export class LocalStorage {\n   /**\n    * @param    {string} prefix Prefix to append to all incoming keys.\n    */\n   constructor(prefix) {\n     this.prefix = prefix;\n   }\n \n+  async isDurable() {\n+    const durabilityStatus = localStorage.getItem(STORAGE_DURABILITY_KEY);\n+    return (parseInt(durabilityStatus, 10) >= 2);\n+  }\n+\n   _makeKey(key) {\n     return `${this.prefix}-${key}`;\n   }\n \n   async getItem(key) {\n-    return localStorage.getItem(this._makeKey(key));\n+    const storageIsDurable = await this.isDurable();\n+    if (!storageIsDurable && !this.testing) {","path":"client/selfrepair/normandy_driver.js","position":null,"original_position":30,"commit_id":"710bf7efa61187df4a4b9c69222967f3c14b6ed1","original_commit_id":"3fce5a3816f9cf45adc0ebeba96fa40459d27a66","user":{"login":"mythmon","id":305049,"avatar_url":"https://avatars.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false},"body":"I changed this to `this.skipDurability`, and made the driver pass it in based on the value of `NormandyDriver::testing`.","created_at":"2016-11-09T00:19:53Z","updated_at":"2016-11-09T00:35:26Z","html_url":"https://github.com/mozilla/normandy/pull/313#discussion_r87113841","pull_request_url":"https://api.github.com/repos/mozilla/normandy/pulls/313","_links":{"self":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/comments/87113841"},"html":{"href":"https://github.com/mozilla/normandy/pull/313#discussion_r87113841"},"pull_request":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/313"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/normandy/pulls/313","id":92634383,"html_url":"https://github.com/mozilla/normandy/pull/313","diff_url":"https://github.com/mozilla/normandy/pull/313.diff","patch_url":"https://github.com/mozilla/normandy/pull/313.patch","issue_url":"https://api.github.com/repos/mozilla/normandy/issues/313","number":313,"state":"open","locked":false,"title":"Check durability of storage in driver","user":{"login":"mythmon","id":305049,"avatar_url":"https://avatars.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false},"body":"#291, retargeted at master with more tests.\r\n\r\nAlso, the driver now automatically JSON serializes/deserializes things, which is super helpful.","created_at":"2016-11-07T18:08:04Z","updated_at":"2016-11-09T00:35:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcfe790aec2fecd1465a49a721e5b7e88b045034","assignee":{"login":"Osmose","id":193106,"avatar_url":"https://avatars.githubusercontent.com/u/193106?v=3","gravatar_id":"","url":"https://api.github.com/users/Osmose","html_url":"https://github.com/Osmose","followers_url":"https://api.github.com/users/Osmose/followers","following_url":"https://api.github.com/users/Osmose/following{/other_user}","gists_url":"https://api.github.com/users/Osmose/gists{/gist_id}","starred_url":"https://api.github.com/users/Osmose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Osmose/subscriptions","organizations_url":"https://api.github.com/users/Osmose/orgs","repos_url":"https://api.github.com/users/Osmose/repos","events_url":"https://api.github.com/users/Osmose/events{/privacy}","received_events_url":"https://api.github.com/users/Osmose/received_events","type":"User","site_admin":false},"assignees":[{"login":"Osmose","id":193106,"avatar_url":"https://avatars.githubusercontent.com/u/193106?v=3","gravatar_id":"","url":"https://api.github.com/users/Osmose","html_url":"https://github.com/Osmose","followers_url":"https://api.github.com/users/Osmose/followers","following_url":"https://api.github.com/users/Osmose/following{/other_user}","gists_url":"https://api.github.com/users/Osmose/gists{/gist_id}","starred_url":"https://api.github.com/users/Osmose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Osmose/subscriptions","organizations_url":"https://api.github.com/users/Osmose/orgs","repos_url":"https://api.github.com/users/Osmose/repos","events_url":"https://api.github.com/users/Osmose/events{/privacy}","received_events_url":"https://api.github.com/users/Osmose/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/normandy/pulls/313/commits","review_comments_url":"https://api.github.com/repos/mozilla/normandy/pulls/313/comments","review_comment_url":"https://api.github.com/repos/mozilla/normandy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/normandy/issues/313/comments","statuses_url":"https://api.github.com/repos/mozilla/normandy/statuses/710bf7efa61187df4a4b9c69222967f3c14b6ed1","head":{"label":"mythmon:storage-durability","ref":"storage-durability","sha":"710bf7efa61187df4a4b9c69222967f3c14b6ed1","user":{"login":"mythmon","id":305049,"avatar_url":"https://avatars.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false},"repo":{"id":49591352,"name":"normandy","full_name":"mythmon/normandy","owner":{"login":"mythmon","id":305049,"avatar_url":"https://avatars.githubusercontent.com/u/305049?v=3","gravatar_id":"","url":"https://api.github.com/users/mythmon","html_url":"https://github.com/mythmon","followers_url":"https://api.github.com/users/mythmon/followers","following_url":"https://api.github.com/users/mythmon/following{/other_user}","gists_url":"https://api.github.com/users/mythmon/gists{/gist_id}","starred_url":"https://api.github.com/users/mythmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythmon/subscriptions","organizations_url":"https://api.github.com/users/mythmon/orgs","repos_url":"https://api.github.com/users/mythmon/repos","events_url":"https://api.github.com/users/mythmon/events{/privacy}","received_events_url":"https://api.github.com/users/mythmon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mythmon/normandy","description":"Self-Repair 2","fork":true,"url":"https://api.github.com/repos/mythmon/normandy","forks_url":"https://api.github.com/repos/mythmon/normandy/forks","keys_url":"https://api.github.com/repos/mythmon/normandy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mythmon/normandy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mythmon/normandy/teams","hooks_url":"https://api.github.com/repos/mythmon/normandy/hooks","issue_events_url":"https://api.github.com/repos/mythmon/normandy/issues/events{/number}","events_url":"https://api.github.com/repos/mythmon/normandy/events","assignees_url":"https://api.github.com/repos/mythmon/normandy/assignees{/user}","branches_url":"https://api.github.com/repos/mythmon/normandy/branches{/branch}","tags_url":"https://api.github.com/repos/mythmon/normandy/tags","blobs_url":"https://api.github.com/repos/mythmon/normandy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mythmon/normandy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mythmon/normandy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mythmon/normandy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mythmon/normandy/statuses/{sha}","languages_url":"https://api.github.com/repos/mythmon/normandy/languages","stargazers_url":"https://api.github.com/repos/mythmon/normandy/stargazers","contributors_url":"https://api.github.com/repos/mythmon/normandy/contributors","subscribers_url":"https://api.github.com/repos/mythmon/normandy/subscribers","subscription_url":"https://api.github.com/repos/mythmon/normandy/subscription","commits_url":"https://api.github.com/repos/mythmon/normandy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mythmon/normandy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mythmon/normandy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mythmon/normandy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mythmon/normandy/contents/{+path}","compare_url":"https://api.github.com/repos/mythmon/normandy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mythmon/normandy/merges","archive_url":"https://api.github.com/repos/mythmon/normandy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mythmon/normandy/downloads","issues_url":"https://api.github.com/repos/mythmon/normandy/issues{/number}","pulls_url":"https://api.github.com/repos/mythmon/normandy/pulls{/number}","milestones_url":"https://api.github.com/repos/mythmon/normandy/milestones{/number}","notifications_url":"https://api.github.com/repos/mythmon/normandy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mythmon/normandy/labels{/name}","releases_url":"https://api.github.com/repos/mythmon/normandy/releases{/id}","deployments_url":"https://api.github.com/repos/mythmon/normandy/deployments","created_at":"2016-01-13T17:54:36Z","updated_at":"2016-04-21T19:26:03Z","pushed_at":"2016-11-09T00:31:42Z","git_url":"git://github.com/mythmon/normandy.git","ssh_url":"git@github.com:mythmon/normandy.git","clone_url":"https://github.com/mythmon/normandy.git","svn_url":"https://github.com/mythmon/normandy","homepage":"http://normandy.readthedocs.org/","size":2245,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"0401934d6eef2b44e7a8d45bebb4aaff3cc44840","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":48456638,"name":"normandy","full_name":"mozilla/normandy","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/normandy","description":"Firefox recipe server","fork":false,"url":"https://api.github.com/repos/mozilla/normandy","forks_url":"https://api.github.com/repos/mozilla/normandy/forks","keys_url":"https://api.github.com/repos/mozilla/normandy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/normandy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/normandy/teams","hooks_url":"https://api.github.com/repos/mozilla/normandy/hooks","issue_events_url":"https://api.github.com/repos/mozilla/normandy/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/normandy/events","assignees_url":"https://api.github.com/repos/mozilla/normandy/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/normandy/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/normandy/tags","blobs_url":"https://api.github.com/repos/mozilla/normandy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/normandy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/normandy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/normandy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/normandy/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/normandy/languages","stargazers_url":"https://api.github.com/repos/mozilla/normandy/stargazers","contributors_url":"https://api.github.com/repos/mozilla/normandy/contributors","subscribers_url":"https://api.github.com/repos/mozilla/normandy/subscribers","subscription_url":"https://api.github.com/repos/mozilla/normandy/subscription","commits_url":"https://api.github.com/repos/mozilla/normandy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/normandy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/normandy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/normandy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/normandy/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/normandy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/normandy/merges","archive_url":"https://api.github.com/repos/mozilla/normandy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/normandy/downloads","issues_url":"https://api.github.com/repos/mozilla/normandy/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/normandy/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/normandy/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/normandy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/normandy/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/normandy/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/normandy/deployments","created_at":"2015-12-22T22:18:19Z","updated_at":"2016-10-28T00:10:35Z","pushed_at":"2016-11-09T00:31:43Z","git_url":"git://github.com/mozilla/normandy.git","ssh_url":"git@github.com:mozilla/normandy.git","clone_url":"https://github.com/mozilla/normandy.git","svn_url":"https://github.com/mozilla/normandy","homepage":"https://wiki.mozilla.org/Firefox/Recipe_Server","size":2311,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":20,"forks":14,"open_issues":20,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/313"},"html":{"href":"https://github.com/mozilla/normandy/pull/313"},"issue":{"href":"https://api.github.com/repos/mozilla/normandy/issues/313"},"comments":{"href":"https://api.github.com/repos/mozilla/normandy/issues/313/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/313/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/normandy/pulls/313/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/normandy/statuses/710bf7efa61187df4a4b9c69222967f3c14b6ed1"}}}}
{"actor":{"display_login":"mythmon"}}