{"action":"created","comment":{"url":"https://api.github.com/repos/duckduckgo/Android/pulls/comments/199780102","pull_request_review_id":133964150,"id":199780102,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTc4MDEwMg==","diff_hunk":"@@ -244,11 +246,12 @@ class BrowserTabViewModel(\n         autoCompleteViewState.value = AutoCompleteViewState(false)\n     }\n \n-    override fun progressChanged(newProgress: Int) {\n+    override fun progressChanged(newProgress: Int, canGoBack: Boolean, canGoForward: Boolean) {\n         Timber.v(\"Loading in progress $newProgress\")\n \n         val progress = currentLoadingViewState()\n         loadingViewState.value = progress.copy(progress = newProgress)\n+        browserViewState.value = currentBrowserViewState().copy(canGoBack = canGoBack, canGoForward = canGoForward)","path":"app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt","position":21,"original_position":21,"commit_id":"194e6ec13dcd808f72e8d4341bf28e353eb29e84","original_commit_id":"194e6ec13dcd808f72e8d4341bf28e353eb29e84","user":{"login":"CDRussell","id":1336281,"node_id":"MDQ6VXNlcjEzMzYyODE=","avatar_url":"https://avatars2.githubusercontent.com/u/1336281?v=4","gravatar_id":"","url":"https://api.github.com/users/CDRussell","html_url":"https://github.com/CDRussell","followers_url":"https://api.github.com/users/CDRussell/followers","following_url":"https://api.github.com/users/CDRussell/following{/other_user}","gists_url":"https://api.github.com/users/CDRussell/gists{/gist_id}","starred_url":"https://api.github.com/users/CDRussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CDRussell/subscriptions","organizations_url":"https://api.github.com/users/CDRussell/orgs","repos_url":"https://api.github.com/users/CDRussell/repos","events_url":"https://api.github.com/users/CDRussell/events{/privacy}","received_events_url":"https://api.github.com/users/CDRussell/received_events","type":"User","site_admin":false},"body":"It's tricky to draw the lines between them, as they do all feel pretty related.\r\n\r\nHowever, I'd leave those two separate because they don't always both get updated. While a change in progress here does result in changes to both, there are other places where a change to the browser state **does not** result in changes to progress. So they are, at times, completely independent.","created_at":"2018-07-03T12:00:19Z","updated_at":"2018-07-03T12:00:19Z","html_url":"https://github.com/duckduckgo/Android/pull/302#discussion_r199780102","pull_request_url":"https://api.github.com/repos/duckduckgo/Android/pulls/302","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/Android/pulls/comments/199780102"},"html":{"href":"https://github.com/duckduckgo/Android/pull/302#discussion_r199780102"},"pull_request":{"href":"https://api.github.com/repos/duckduckgo/Android/pulls/302"}},"in_reply_to_id":199775096},"pull_request":{"url":"https://api.github.com/repos/duckduckgo/Android/pulls/302","id":198922266,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4OTIyMjY2","html_url":"https://github.com/duckduckgo/Android/pull/302","diff_url":"https://github.com/duckduckgo/Android/pull/302.diff","patch_url":"https://github.com/duckduckgo/Android/pull/302.patch","issue_url":"https://api.github.com/repos/duckduckgo/Android/issues/302","number":302,"state":"open","locked":false,"title":"Fix back/forward browser navigation buttons","user":{"login":"CDRussell","id":1336281,"node_id":"MDQ6VXNlcjEzMzYyODE=","avatar_url":"https://avatars2.githubusercontent.com/u/1336281?v=4","gravatar_id":"","url":"https://api.github.com/users/CDRussell","html_url":"https://github.com/CDRussell","followers_url":"https://api.github.com/users/CDRussell/followers","following_url":"https://api.github.com/users/CDRussell/following{/other_user}","gists_url":"https://api.github.com/users/CDRussell/gists{/gist_id}","starred_url":"https://api.github.com/users/CDRussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CDRussell/subscriptions","organizations_url":"https://api.github.com/users/CDRussell/orgs","repos_url":"https://api.github.com/users/CDRussell/repos","events_url":"https://api.github.com/users/CDRussell/events{/privacy}","received_events_url":"https://api.github.com/users/CDRussell/received_events","type":"User","site_admin":false},"body":"\r\n<!--\r\nNote: This checklist is a reminder of our shared engineering expectations. Feel free to change it, although assigning a GitHub reviewer and the items in bold are required.\r\n-->\r\n\r\nTask/Issue URL: https://app.asana.com/0/414730916066338/727172188146397\r\nTech Design URL: \r\nCC: \r\n\r\n**Description**:\r\nA regression meant that the view state was checked to see if it was identical to the last seen view state. If it was, rendering would skip. But for these forward/back buttons, they also relied on `WebView `state; not just the view state. So we were erroneously skipping updates for them because the view state was identical.\r\n\r\nThe fix is to include these in the view state itself, meaning it won't skip the rendering if `canGoBack()` or `canGoForward()` has changed.\r\n\r\n`onProgressChanged` is the earliest place where the `WebView` starts reporting the correct new states. But I've included the update in `loadingFinished()` too just in case `onProgressChanged()` could be bypassed somehow.\r\n\r\n\r\n**Steps to test this PR**:\r\n1. Browse around, and note the back/forward buttons accurately reflect the `WebView`'s ability to navigate forward or back\r\n\r\n\r\n---\r\n###### Internal references:\r\n[Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552)\r\n[Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943)\r\n","created_at":"2018-07-03T10:44:24Z","updated_at":"2018-07-03T12:00:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b83a9f918974e0979f93e4173e758966eadc2cb","assignee":{"login":"subsymbolic","id":1652407,"node_id":"MDQ6VXNlcjE2NTI0MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/1652407?v=4","gravatar_id":"","url":"https://api.github.com/users/subsymbolic","html_url":"https://github.com/subsymbolic","followers_url":"https://api.github.com/users/subsymbolic/followers","following_url":"https://api.github.com/users/subsymbolic/following{/other_user}","gists_url":"https://api.github.com/users/subsymbolic/gists{/gist_id}","starred_url":"https://api.github.com/users/subsymbolic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subsymbolic/subscriptions","organizations_url":"https://api.github.com/users/subsymbolic/orgs","repos_url":"https://api.github.com/users/subsymbolic/repos","events_url":"https://api.github.com/users/subsymbolic/events{/privacy}","received_events_url":"https://api.github.com/users/subsymbolic/received_events","type":"User","site_admin":false},"assignees":[{"login":"subsymbolic","id":1652407,"node_id":"MDQ6VXNlcjE2NTI0MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/1652407?v=4","gravatar_id":"","url":"https://api.github.com/users/subsymbolic","html_url":"https://github.com/subsymbolic","followers_url":"https://api.github.com/users/subsymbolic/followers","following_url":"https://api.github.com/users/subsymbolic/following{/other_user}","gists_url":"https://api.github.com/users/subsymbolic/gists{/gist_id}","starred_url":"https://api.github.com/users/subsymbolic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subsymbolic/subscriptions","organizations_url":"https://api.github.com/users/subsymbolic/orgs","repos_url":"https://api.github.com/users/subsymbolic/repos","events_url":"https://api.github.com/users/subsymbolic/events{/privacy}","received_events_url":"https://api.github.com/users/subsymbolic/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"brindy","id":81197,"node_id":"MDQ6VXNlcjgxMTk3","avatar_url":"https://avatars0.githubusercontent.com/u/81197?v=4","gravatar_id":"","url":"https://api.github.com/users/brindy","html_url":"https://github.com/brindy","followers_url":"https://api.github.com/users/brindy/followers","following_url":"https://api.github.com/users/brindy/following{/other_user}","gists_url":"https://api.github.com/users/brindy/gists{/gist_id}","starred_url":"https://api.github.com/users/brindy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brindy/subscriptions","organizations_url":"https://api.github.com/users/brindy/orgs","repos_url":"https://api.github.com/users/brindy/repos","events_url":"https://api.github.com/users/brindy/events{/privacy}","received_events_url":"https://api.github.com/users/brindy/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/duckduckgo/Android/pulls/302/commits","review_comments_url":"https://api.github.com/repos/duckduckgo/Android/pulls/302/comments","review_comment_url":"https://api.github.com/repos/duckduckgo/Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/duckduckgo/Android/issues/302/comments","statuses_url":"https://api.github.com/repos/duckduckgo/Android/statuses/194e6ec13dcd808f72e8d4341bf28e353eb29e84","head":{"label":"duckduckgo:feature/fix_forward_back_nav_webview_buttons","ref":"feature/fix_forward_back_nav_webview_buttons","sha":"194e6ec13dcd808f72e8d4341bf28e353eb29e84","user":{"login":"duckduckgo","id":342708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MjcwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/342708?v=4","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":78869127,"node_id":"MDEwOlJlcG9zaXRvcnk3ODg2OTEyNw==","name":"Android","full_name":"duckduckgo/Android","owner":{"login":"duckduckgo","id":342708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MjcwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/342708?v=4","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/Android","description":"DuckDuckGo Android App","fork":false,"url":"https://api.github.com/repos/duckduckgo/Android","forks_url":"https://api.github.com/repos/duckduckgo/Android/forks","keys_url":"https://api.github.com/repos/duckduckgo/Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/Android/teams","hooks_url":"https://api.github.com/repos/duckduckgo/Android/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/Android/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/Android/events","assignees_url":"https://api.github.com/repos/duckduckgo/Android/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/Android/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/Android/tags","blobs_url":"https://api.github.com/repos/duckduckgo/Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/Android/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/Android/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/Android/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/Android/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/Android/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/Android/subscription","commits_url":"https://api.github.com/repos/duckduckgo/Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/duckduckgo/Android/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/Android/merges","archive_url":"https://api.github.com/repos/duckduckgo/Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/Android/downloads","issues_url":"https://api.github.com/repos/duckduckgo/Android/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/Android/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/Android/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/Android/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/Android/releases{/id}","deployments_url":"https://api.github.com/repos/duckduckgo/Android/deployments","created_at":"2017-01-13T17:11:25Z","updated_at":"2018-07-03T09:22:32Z","pushed_at":"2018-07-03T10:44:25Z","git_url":"git://github.com/duckduckgo/Android.git","ssh_url":"git@github.com:duckduckgo/Android.git","clone_url":"https://github.com/duckduckgo/Android.git","svn_url":"https://github.com/duckduckgo/Android","homepage":null,"size":12346,"stargazers_count":491,"watchers_count":491,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":134,"open_issues":22,"watchers":491,"default_branch":"develop"}},"base":{"label":"duckduckgo:develop","ref":"develop","sha":"d8c22e2ee03566fa50ac3891de27dd603e0a3c7c","user":{"login":"duckduckgo","id":342708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MjcwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/342708?v=4","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":78869127,"node_id":"MDEwOlJlcG9zaXRvcnk3ODg2OTEyNw==","name":"Android","full_name":"duckduckgo/Android","owner":{"login":"duckduckgo","id":342708,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MjcwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/342708?v=4","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/Android","description":"DuckDuckGo Android App","fork":false,"url":"https://api.github.com/repos/duckduckgo/Android","forks_url":"https://api.github.com/repos/duckduckgo/Android/forks","keys_url":"https://api.github.com/repos/duckduckgo/Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/Android/teams","hooks_url":"https://api.github.com/repos/duckduckgo/Android/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/Android/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/Android/events","assignees_url":"https://api.github.com/repos/duckduckgo/Android/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/Android/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/Android/tags","blobs_url":"https://api.github.com/repos/duckduckgo/Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/Android/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/Android/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/Android/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/Android/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/Android/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/Android/subscription","commits_url":"https://api.github.com/repos/duckduckgo/Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/duckduckgo/Android/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/Android/merges","archive_url":"https://api.github.com/repos/duckduckgo/Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/Android/downloads","issues_url":"https://api.github.com/repos/duckduckgo/Android/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/Android/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/Android/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/Android/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/Android/releases{/id}","deployments_url":"https://api.github.com/repos/duckduckgo/Android/deployments","created_at":"2017-01-13T17:11:25Z","updated_at":"2018-07-03T09:22:32Z","pushed_at":"2018-07-03T10:44:25Z","git_url":"git://github.com/duckduckgo/Android.git","ssh_url":"git@github.com:duckduckgo/Android.git","clone_url":"https://github.com/duckduckgo/Android.git","svn_url":"https://github.com/duckduckgo/Android","homepage":null,"size":12346,"stargazers_count":491,"watchers_count":491,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":134,"open_issues":22,"watchers":491,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/Android/pulls/302"},"html":{"href":"https://github.com/duckduckgo/Android/pull/302"},"issue":{"href":"https://api.github.com/repos/duckduckgo/Android/issues/302"},"comments":{"href":"https://api.github.com/repos/duckduckgo/Android/issues/302/comments"},"review_comments":{"href":"https://api.github.com/repos/duckduckgo/Android/pulls/302/comments"},"review_comment":{"href":"https://api.github.com/repos/duckduckgo/Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/duckduckgo/Android/pulls/302/commits"},"statuses":{"href":"https://api.github.com/repos/duckduckgo/Android/statuses/194e6ec13dcd808f72e8d4341bf28e353eb29e84"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"CDRussell"}}