{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/comments/87865032","pull_request_review_id":8458641,"id":87865032,"diff_hunk":"@@ -107,15 +107,21 @@ public class SQLiteHistory {\n     let favicons: FaviconsTable<Favicon>\n     let prefs: Prefs\n \n-    required public init?(db: BrowserDB, prefs: Prefs) {\n+    required public init(db: BrowserDB, prefs: Prefs) {\n         self.db = db\n         self.favicons = FaviconsTable<Favicon>()\n         self.prefs = prefs\n \n         // BrowserTable exists only to perform create/update etc. operations -- it's not\n         // a queryable thing that needs to stick around.\n-        if !db.createOrUpdate(BrowserTable()) {\n-            return nil\n+        switch db.createOrUpdate(BrowserTable()) {\n+        case .Failure:\n+            log.error(\"Failed to create/update the scheme table. Aborting.\")","path":"Storage/SQL/SQLiteHistory.swift","position":16,"original_position":16,"commit_id":"7844bc8a4a5eedf17182f5b69350737a9b9b7990","original_commit_id":"7844bc8a4a5eedf17182f5b69350737a9b9b7990","user":{"login":"rnewman","id":91722,"avatar_url":"https://avatars.githubusercontent.com/u/91722?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewman","html_url":"https://github.com/rnewman","followers_url":"https://api.github.com/users/rnewman/followers","following_url":"https://api.github.com/users/rnewman/following{/other_user}","gists_url":"https://api.github.com/users/rnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewman/subscriptions","organizations_url":"https://api.github.com/users/rnewman/orgs","repos_url":"https://api.github.com/users/rnewman/repos","events_url":"https://api.github.com/users/rnewman/events{/privacy}","received_events_url":"https://api.github.com/users/rnewman/received_events","type":"User","site_admin":false},"body":"Tweak this log message.","created_at":"2016-11-14T18:44:48Z","updated_at":"2016-11-14T18:44:48Z","html_url":"https://github.com/mozilla-mobile/firefox-ios/pull/2230#discussion_r87865032","pull_request_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/2230","_links":{"self":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/comments/87865032"},"html":{"href":"https://github.com/mozilla-mobile/firefox-ios/pull/2230#discussion_r87865032"},"pull_request":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/2230"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/2230","id":93172673,"html_url":"https://github.com/mozilla-mobile/firefox-ios/pull/2230","diff_url":"https://github.com/mozilla-mobile/firefox-ios/pull/2230.diff","patch_url":"https://github.com/mozilla-mobile/firefox-ios/pull/2230.patch","issue_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues/2230","number":2230,"state":"open","locked":false,"title":"Bug 1315755 - Added FailedSQLiteHistory class in situations the DB is closed","user":{"login":"sleroux","id":434322,"avatar_url":"https://avatars.githubusercontent.com/u/434322?v=3","gravatar_id":"","url":"https://api.github.com/users/sleroux","html_url":"https://github.com/sleroux","followers_url":"https://api.github.com/users/sleroux/followers","following_url":"https://api.github.com/users/sleroux/following{/other_user}","gists_url":"https://api.github.com/users/sleroux/gists{/gist_id}","starred_url":"https://api.github.com/users/sleroux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleroux/subscriptions","organizations_url":"https://api.github.com/users/sleroux/orgs","repos_url":"https://api.github.com/users/sleroux/repos","events_url":"https://api.github.com/users/sleroux/events{/privacy}","received_events_url":"https://api.github.com/users/sleroux/received_events","type":"User","site_admin":false},"body":"With the recent changes to closing the database when we're in the background, there are times when we try to grab an instance of SQLiteHistory and it returns nil. At the moment, this is force-unwrapped which is causing crashes. Instead of modifying the API to return an optional, I've created a FailedSQLiteHistory class to swap in for the real one when we are not able to open the database.","created_at":"2016-11-10T15:33:20Z","updated_at":"2016-11-14T18:46:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7820c099097f1e7fd690adc03cba26a7dea86be8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/2230/commits","review_comments_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/2230/comments","review_comment_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues/2230/comments","statuses_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/statuses/7844bc8a4a5eedf17182f5b69350737a9b9b7990","head":{"label":"mozilla-mobile:sleroux/Bug1315755-SendToViewLaterCrash","ref":"sleroux/Bug1315755-SendToViewLaterCrash","sha":"7844bc8a4a5eedf17182f5b69350737a9b9b7990","user":{"login":"mozilla-mobile","id":22351667,"avatar_url":"https://avatars.githubusercontent.com/u/22351667?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-mobile","html_url":"https://github.com/mozilla-mobile","followers_url":"https://api.github.com/users/mozilla-mobile/followers","following_url":"https://api.github.com/users/mozilla-mobile/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-mobile/subscriptions","organizations_url":"https://api.github.com/users/mozilla-mobile/orgs","repos_url":"https://api.github.com/users/mozilla-mobile/repos","events_url":"https://api.github.com/users/mozilla-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":26133979,"name":"firefox-ios","full_name":"mozilla-mobile/firefox-ios","owner":{"login":"mozilla-mobile","id":22351667,"avatar_url":"https://avatars.githubusercontent.com/u/22351667?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-mobile","html_url":"https://github.com/mozilla-mobile","followers_url":"https://api.github.com/users/mozilla-mobile/followers","following_url":"https://api.github.com/users/mozilla-mobile/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-mobile/subscriptions","organizations_url":"https://api.github.com/users/mozilla-mobile/orgs","repos_url":"https://api.github.com/users/mozilla-mobile/repos","events_url":"https://api.github.com/users/mozilla-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-mobile/firefox-ios","description":"Firefox for iOS","fork":false,"url":"https://api.github.com/repos/mozilla-mobile/firefox-ios","forks_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/forks","keys_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/teams","hooks_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/hooks","issue_events_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/events","assignees_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/tags","blobs_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/languages","stargazers_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/stargazers","contributors_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/contributors","subscribers_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/subscribers","subscription_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/subscription","commits_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/merges","archive_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/downloads","issues_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/deployments","created_at":"2014-11-03T19:07:02Z","updated_at":"2016-11-14T17:56:09Z","pushed_at":"2016-11-11T20:15:10Z","git_url":"git://github.com/mozilla-mobile/firefox-ios.git","ssh_url":"git@github.com:mozilla-mobile/firefox-ios.git","clone_url":"https://github.com/mozilla-mobile/firefox-ios.git","svn_url":"https://github.com/mozilla-mobile/firefox-ios","homepage":"","size":366542,"stargazers_count":6579,"watchers_count":6579,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1344,"mirror_url":null,"open_issues_count":52,"forks":1344,"open_issues":52,"watchers":6579,"default_branch":"master"}},"base":{"label":"mozilla-mobile:master","ref":"master","sha":"1f93b0a7031ab1d46825fa68f12657d4e54e31d8","user":{"login":"mozilla-mobile","id":22351667,"avatar_url":"https://avatars.githubusercontent.com/u/22351667?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-mobile","html_url":"https://github.com/mozilla-mobile","followers_url":"https://api.github.com/users/mozilla-mobile/followers","following_url":"https://api.github.com/users/mozilla-mobile/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-mobile/subscriptions","organizations_url":"https://api.github.com/users/mozilla-mobile/orgs","repos_url":"https://api.github.com/users/mozilla-mobile/repos","events_url":"https://api.github.com/users/mozilla-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":26133979,"name":"firefox-ios","full_name":"mozilla-mobile/firefox-ios","owner":{"login":"mozilla-mobile","id":22351667,"avatar_url":"https://avatars.githubusercontent.com/u/22351667?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-mobile","html_url":"https://github.com/mozilla-mobile","followers_url":"https://api.github.com/users/mozilla-mobile/followers","following_url":"https://api.github.com/users/mozilla-mobile/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-mobile/subscriptions","organizations_url":"https://api.github.com/users/mozilla-mobile/orgs","repos_url":"https://api.github.com/users/mozilla-mobile/repos","events_url":"https://api.github.com/users/mozilla-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-mobile/firefox-ios","description":"Firefox for iOS","fork":false,"url":"https://api.github.com/repos/mozilla-mobile/firefox-ios","forks_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/forks","keys_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/teams","hooks_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/hooks","issue_events_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/events","assignees_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/tags","blobs_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/languages","stargazers_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/stargazers","contributors_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/contributors","subscribers_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/subscribers","subscription_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/subscription","commits_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/merges","archive_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/downloads","issues_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-mobile/firefox-ios/deployments","created_at":"2014-11-03T19:07:02Z","updated_at":"2016-11-14T17:56:09Z","pushed_at":"2016-11-11T20:15:10Z","git_url":"git://github.com/mozilla-mobile/firefox-ios.git","ssh_url":"git@github.com:mozilla-mobile/firefox-ios.git","clone_url":"https://github.com/mozilla-mobile/firefox-ios.git","svn_url":"https://github.com/mozilla-mobile/firefox-ios","homepage":"","size":366542,"stargazers_count":6579,"watchers_count":6579,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1344,"mirror_url":null,"open_issues_count":52,"forks":1344,"open_issues":52,"watchers":6579,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/2230"},"html":{"href":"https://github.com/mozilla-mobile/firefox-ios/pull/2230"},"issue":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues/2230"},"comments":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/issues/2230/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/2230/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/pulls/2230/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-mobile/firefox-ios/statuses/7844bc8a4a5eedf17182f5b69350737a9b9b7990"}}}}
{"actor":{"display_login":"rnewman"}}