{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cordova-ios/pulls/comments/183622338","pull_request_review_id":114652825,"id":183622338,"diff_hunk":"@@ -720,12 +720,25 @@ - (void)onAppWillTerminate:(NSNotification*)notification\n     }\n }\n \n+- (void)checkAndReinitViewUrl\n+{\n+    if ([[[self.webViewEngine URL] absoluteString] isEqualToString:@\"about:blank\"]) {","path":"CordovaLib/Classes/Public/CDVViewController.m","position":6,"original_position":6,"commit_id":"9776356c91580769cc5cd1208cf623d4ee9dba70","original_commit_id":"9776356c91580769cc5cd1208cf623d4ee9dba70","user":{"login":"shazron","id":36107,"avatar_url":"https://avatars0.githubusercontent.com/u/36107?v=4","gravatar_id":"","url":"https://api.github.com/users/shazron","html_url":"https://github.com/shazron","followers_url":"https://api.github.com/users/shazron/followers","following_url":"https://api.github.com/users/shazron/following{/other_user}","gists_url":"https://api.github.com/users/shazron/gists{/gist_id}","starred_url":"https://api.github.com/users/shazron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shazron/subscriptions","organizations_url":"https://api.github.com/users/shazron/orgs","repos_url":"https://api.github.com/users/shazron/repos","events_url":"https://api.github.com/users/shazron/events{/privacy}","received_events_url":"https://api.github.com/users/shazron/received_events","type":"User","site_admin":false},"body":"In the unlikely scenario that `appURL` is actually `about:blank`, you should check for this condition.\r\nRIght now there is no probability of an infinite loop, but you never know if there are side-effects with any calls further down the stack in `checkAndReinitViewUrl `\r\n\r\nI would return a `BOOL` from this function (`YES` if it re-inited, 'NO' if it did not), and add a unit test in https://github.com/apache/cordova-ios/blob/master/tests/CordovaLibTests/CDVViewControllerTest.m","created_at":"2018-04-24T06:59:22Z","updated_at":"2018-04-24T06:59:55Z","html_url":"https://github.com/apache/cordova-ios/pull/363#discussion_r183622338","pull_request_url":"https://api.github.com/repos/apache/cordova-ios/pulls/363","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/comments/183622338"},"html":{"href":"https://github.com/apache/cordova-ios/pull/363#discussion_r183622338"},"pull_request":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/363"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cordova-ios/pulls/363","id":183381664,"html_url":"https://github.com/apache/cordova-ios/pull/363","diff_url":"https://github.com/apache/cordova-ios/pull/363.diff","patch_url":"https://github.com/apache/cordova-ios/pull/363.patch","issue_url":"https://api.github.com/repos/apache/cordova-ios/issues/363","number":363,"state":"open","locked":false,"title":"reinit url after app freezes","user":{"login":"svalaskevicius","id":893660,"avatar_url":"https://avatars0.githubusercontent.com/u/893660?v=4","gravatar_id":"","url":"https://api.github.com/users/svalaskevicius","html_url":"https://github.com/svalaskevicius","followers_url":"https://api.github.com/users/svalaskevicius/followers","following_url":"https://api.github.com/users/svalaskevicius/following{/other_user}","gists_url":"https://api.github.com/users/svalaskevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/svalaskevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svalaskevicius/subscriptions","organizations_url":"https://api.github.com/users/svalaskevicius/orgs","repos_url":"https://api.github.com/users/svalaskevicius/repos","events_url":"https://api.github.com/users/svalaskevicius/events{/privacy}","received_events_url":"https://api.github.com/users/svalaskevicius/received_events","type":"User","site_admin":false},"body":"Hi!\r\n\r\nWe've stumbled on a similar issue to this: https://issues.apache.org/jira/browse/CB-14045 although for us it takes a bit longer (10h or so of app being in background).\r\n\r\nIn our case the app resumes in a half working state, where the web view has been reinitialised pointing to about:blank with only default Js api available and no cordova js. Then, cordova tries to emit those resume and other events but all of them fail as there is no cordova js var available.\r\n\r\nthis approach does not fix app getting into that state as I am not fully aware how does it do that (12h debugging cycle is pretty hard).. but it gets it out of the broken state by pointing the webview back to the app's url.\r\n\r\n\r\nwhat do you think?\r\n\r\nThanks!","created_at":"2018-04-23T09:55:47Z","updated_at":"2018-04-24T06:59:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e4bde2e87d993123483d150e37b340b0f65d548","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/cordova-ios/pulls/363/commits","review_comments_url":"https://api.github.com/repos/apache/cordova-ios/pulls/363/comments","review_comment_url":"https://api.github.com/repos/apache/cordova-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cordova-ios/issues/363/comments","statuses_url":"https://api.github.com/repos/apache/cordova-ios/statuses/9776356c91580769cc5cd1208cf623d4ee9dba70","head":{"label":"svalaskevicius:test-reinit-url","ref":"test-reinit-url","sha":"9776356c91580769cc5cd1208cf623d4ee9dba70","user":{"login":"svalaskevicius","id":893660,"avatar_url":"https://avatars0.githubusercontent.com/u/893660?v=4","gravatar_id":"","url":"https://api.github.com/users/svalaskevicius","html_url":"https://github.com/svalaskevicius","followers_url":"https://api.github.com/users/svalaskevicius/followers","following_url":"https://api.github.com/users/svalaskevicius/following{/other_user}","gists_url":"https://api.github.com/users/svalaskevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/svalaskevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svalaskevicius/subscriptions","organizations_url":"https://api.github.com/users/svalaskevicius/orgs","repos_url":"https://api.github.com/users/svalaskevicius/repos","events_url":"https://api.github.com/users/svalaskevicius/events{/privacy}","received_events_url":"https://api.github.com/users/svalaskevicius/received_events","type":"User","site_admin":false},"repo":{"id":130040489,"name":"cordova-ios","full_name":"svalaskevicius/cordova-ios","owner":{"login":"svalaskevicius","id":893660,"avatar_url":"https://avatars0.githubusercontent.com/u/893660?v=4","gravatar_id":"","url":"https://api.github.com/users/svalaskevicius","html_url":"https://github.com/svalaskevicius","followers_url":"https://api.github.com/users/svalaskevicius/followers","following_url":"https://api.github.com/users/svalaskevicius/following{/other_user}","gists_url":"https://api.github.com/users/svalaskevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/svalaskevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svalaskevicius/subscriptions","organizations_url":"https://api.github.com/users/svalaskevicius/orgs","repos_url":"https://api.github.com/users/svalaskevicius/repos","events_url":"https://api.github.com/users/svalaskevicius/events{/privacy}","received_events_url":"https://api.github.com/users/svalaskevicius/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/svalaskevicius/cordova-ios","description":"Mirror of Apache Cordova iOS","fork":true,"url":"https://api.github.com/repos/svalaskevicius/cordova-ios","forks_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/forks","keys_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/teams","hooks_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/hooks","issue_events_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/issues/events{/number}","events_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/events","assignees_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/assignees{/user}","branches_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/branches{/branch}","tags_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/tags","blobs_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/languages","stargazers_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/stargazers","contributors_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/contributors","subscribers_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/subscribers","subscription_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/subscription","commits_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/contents/{+path}","compare_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/merges","archive_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/downloads","issues_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/issues{/number}","pulls_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/labels{/name}","releases_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/releases{/id}","deployments_url":"https://api.github.com/repos/svalaskevicius/cordova-ios/deployments","created_at":"2018-04-18T09:44:17Z","updated_at":"2018-04-18T09:44:20Z","pushed_at":"2018-04-18T09:45:27Z","git_url":"git://github.com/svalaskevicius/cordova-ios.git","ssh_url":"git@github.com:svalaskevicius/cordova-ios.git","clone_url":"https://github.com/svalaskevicius/cordova-ios.git","svn_url":"https://github.com/svalaskevicius/cordova-ios","homepage":null,"size":29593,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:4.5.x","ref":"4.5.x","sha":"acf91073e5c106679d2127cfc2692191a39a0bf4","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":6898387,"name":"cordova-ios","full_name":"apache/cordova-ios","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cordova-ios","description":"Mirror of Apache Cordova iOS","fork":false,"url":"https://api.github.com/repos/apache/cordova-ios","forks_url":"https://api.github.com/repos/apache/cordova-ios/forks","keys_url":"https://api.github.com/repos/apache/cordova-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cordova-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cordova-ios/teams","hooks_url":"https://api.github.com/repos/apache/cordova-ios/hooks","issue_events_url":"https://api.github.com/repos/apache/cordova-ios/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cordova-ios/events","assignees_url":"https://api.github.com/repos/apache/cordova-ios/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cordova-ios/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cordova-ios/tags","blobs_url":"https://api.github.com/repos/apache/cordova-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cordova-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cordova-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cordova-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cordova-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cordova-ios/languages","stargazers_url":"https://api.github.com/repos/apache/cordova-ios/stargazers","contributors_url":"https://api.github.com/repos/apache/cordova-ios/contributors","subscribers_url":"https://api.github.com/repos/apache/cordova-ios/subscribers","subscription_url":"https://api.github.com/repos/apache/cordova-ios/subscription","commits_url":"https://api.github.com/repos/apache/cordova-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cordova-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cordova-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cordova-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cordova-ios/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cordova-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cordova-ios/merges","archive_url":"https://api.github.com/repos/apache/cordova-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cordova-ios/downloads","issues_url":"https://api.github.com/repos/apache/cordova-ios/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cordova-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cordova-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cordova-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cordova-ios/labels{/name}","releases_url":"https://api.github.com/repos/apache/cordova-ios/releases{/id}","deployments_url":"https://api.github.com/repos/apache/cordova-ios/deployments","created_at":"2012-11-28T08:00:23Z","updated_at":"2018-04-21T14:24:05Z","pushed_at":"2018-04-23T09:55:48Z","git_url":"git://github.com/apache/cordova-ios.git","ssh_url":"git@github.com:apache/cordova-ios.git","clone_url":"https://github.com/apache/cordova-ios.git","svn_url":"https://github.com/apache/cordova-ios","homepage":null,"size":29589,"stargazers_count":1422,"watchers_count":1422,"language":"Objective-C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":733,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":733,"open_issues":5,"watchers":1422,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/363"},"html":{"href":"https://github.com/apache/cordova-ios/pull/363"},"issue":{"href":"https://api.github.com/repos/apache/cordova-ios/issues/363"},"comments":{"href":"https://api.github.com/repos/apache/cordova-ios/issues/363/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/363/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cordova-ios/pulls/363/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cordova-ios/statuses/9776356c91580769cc5cd1208cf623d4ee9dba70"}},"author_association":"NONE"}}
{"actor":{"display_login":"shazron"}}