{"action":"created","comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/comments/239997685","pull_request_review_id":182936548,"id":239997685,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTk5NzY4NQ==","diff_hunk":"@@ -361,13 +399,41 @@ public ListenerToken addChangeListener(Executor executor, ReplicatorChangeListen\n     }\n \n     /**\n-     * Remove the given ReplicatorChangeListener from the this replicator.\n+     * Remove the given ReplicatorChangeListener or DocumentReplicatedListener from the this replicator.\n      */\n     public void removeChangeListener(ListenerToken token) {\n         synchronized (lock) {\n-            if (token == null || !(token instanceof ReplicatorChangeListenerToken))\n+            if (token == null || (!(token instanceof ReplicatorChangeListenerToken) && !(token instanceof DocumentReplicatedListenerToken)))\n                 throw new IllegalArgumentException();\n-            changeListenerTokens.remove(token);\n+            if(docEndedListenerTokens.remove(token)==true) {","path":"shared/src/main/java/com/couchbase/lite/AbstractReplicator.java","position":96,"original_position":96,"commit_id":"25eab1de6e4f2bf3c8c8139e1a6e4a627629295d","original_commit_id":"9edb0d296bf757a4f91a3d80cb8d98aeebfb855b","user":{"login":"pasin","id":801454,"node_id":"MDQ6VXNlcjgwMTQ1NA==","avatar_url":"https://avatars1.githubusercontent.com/u/801454?v=4","gravatar_id":"","url":"https://api.github.com/users/pasin","html_url":"https://github.com/pasin","followers_url":"https://api.github.com/users/pasin/followers","following_url":"https://api.github.com/users/pasin/following{/other_user}","gists_url":"https://api.github.com/users/pasin/gists{/gist_id}","starred_url":"https://api.github.com/users/pasin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasin/subscriptions","organizations_url":"https://api.github.com/users/pasin/orgs","repos_url":"https://api.github.com/users/pasin/repos","events_url":"https://api.github.com/users/pasin/events{/privacy}","received_events_url":"https://api.github.com/users/pasin/received_events","type":"User","site_admin":false},"body":"I’m not sure I understand your point. It’s not about performance here. The reason to set the progress level to overall when the size of docEndedListenerToken set is zero because there could be more than one listener added; set to overall should be done when all listeners are removed.","created_at":"2018-12-08T08:01:55Z","updated_at":"2018-12-08T08:01:55Z","html_url":"https://github.com/couchbase/couchbase-lite-android/pull/1789#discussion_r239997685","pull_request_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/1789","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/comments/239997685"},"html":{"href":"https://github.com/couchbase/couchbase-lite-android/pull/1789#discussion_r239997685"},"pull_request":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/1789"}},"in_reply_to_id":239983626},"pull_request":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/1789","id":235965156,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1OTY1MTU2","html_url":"https://github.com/couchbase/couchbase-lite-android/pull/1789","diff_url":"https://github.com/couchbase/couchbase-lite-android/pull/1789.diff","patch_url":"https://github.com/couchbase/couchbase-lite-android/pull/1789.patch","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/1789","number":1789,"state":"open","locked":false,"title":"Document Replication Eventing","user":{"login":"Sandychuang8","id":16504419,"node_id":"MDQ6VXNlcjE2NTA0NDE5","avatar_url":"https://avatars1.githubusercontent.com/u/16504419?v=4","gravatar_id":"","url":"https://api.github.com/users/Sandychuang8","html_url":"https://github.com/Sandychuang8","followers_url":"https://api.github.com/users/Sandychuang8/followers","following_url":"https://api.github.com/users/Sandychuang8/following{/other_user}","gists_url":"https://api.github.com/users/Sandychuang8/gists{/gist_id}","starred_url":"https://api.github.com/users/Sandychuang8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sandychuang8/subscriptions","organizations_url":"https://api.github.com/users/Sandychuang8/orgs","repos_url":"https://api.github.com/users/Sandychuang8/repos","events_url":"https://api.github.com/users/Sandychuang8/events{/privacy}","received_events_url":"https://api.github.com/users/Sandychuang8/received_events","type":"User","site_admin":false},"body":"- add replicator progress level enum, document replicated status class, change name from document error to document ended and fire replicated ended when document replicated.\r\n\r\n- add document replicated listener, and listener token, document replicated update class setter/getter progress level, allow user to add/remove replication listener.\r\n\r\n- add unit test to test push/pull document replicated.","created_at":"2018-12-04T21:27:31Z","updated_at":"2018-12-08T08:01:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e89a5279ba27fb85e67a88a6aeeec7eb46d622fa","assignee":{"login":"Sandychuang8","id":16504419,"node_id":"MDQ6VXNlcjE2NTA0NDE5","avatar_url":"https://avatars1.githubusercontent.com/u/16504419?v=4","gravatar_id":"","url":"https://api.github.com/users/Sandychuang8","html_url":"https://github.com/Sandychuang8","followers_url":"https://api.github.com/users/Sandychuang8/followers","following_url":"https://api.github.com/users/Sandychuang8/following{/other_user}","gists_url":"https://api.github.com/users/Sandychuang8/gists{/gist_id}","starred_url":"https://api.github.com/users/Sandychuang8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sandychuang8/subscriptions","organizations_url":"https://api.github.com/users/Sandychuang8/orgs","repos_url":"https://api.github.com/users/Sandychuang8/repos","events_url":"https://api.github.com/users/Sandychuang8/events{/privacy}","received_events_url":"https://api.github.com/users/Sandychuang8/received_events","type":"User","site_admin":false},"assignees":[{"login":"Sandychuang8","id":16504419,"node_id":"MDQ6VXNlcjE2NTA0NDE5","avatar_url":"https://avatars1.githubusercontent.com/u/16504419?v=4","gravatar_id":"","url":"https://api.github.com/users/Sandychuang8","html_url":"https://github.com/Sandychuang8","followers_url":"https://api.github.com/users/Sandychuang8/followers","following_url":"https://api.github.com/users/Sandychuang8/following{/other_user}","gists_url":"https://api.github.com/users/Sandychuang8/gists{/gist_id}","starred_url":"https://api.github.com/users/Sandychuang8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sandychuang8/subscriptions","organizations_url":"https://api.github.com/users/Sandychuang8/orgs","repos_url":"https://api.github.com/users/Sandychuang8/repos","events_url":"https://api.github.com/users/Sandychuang8/events{/privacy}","received_events_url":"https://api.github.com/users/Sandychuang8/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":322295157,"node_id":"MDU6TGFiZWwzMjIyOTUxNTc=","url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels/in%20progress","name":"in progress","color":"fad8c7","default":false},{"id":113343074,"node_id":"MDU6TGFiZWwxMTMzNDMwNzQ=","url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels/review","name":"review","color":"ededed","default":false},{"id":875163022,"node_id":"MDU6TGFiZWw4NzUxNjMwMjI=","url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels/waffle:in%20progress","name":"waffle:in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/1789/commits","review_comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/1789/comments","review_comment_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/1789/comments","statuses_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/statuses/25eab1de6e4f2bf3c8c8139e1a6e4a627629295d","head":{"label":"couchbase:feature/replication_eveting","ref":"feature/replication_eveting","sha":"25eab1de6e4f2bf3c8c8139e1a6e4a627629295d","user":{"login":"couchbase","id":605755,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwNTc1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/605755?v=4","gravatar_id":"","url":"https://api.github.com/users/couchbase","html_url":"https://github.com/couchbase","followers_url":"https://api.github.com/users/couchbase/followers","following_url":"https://api.github.com/users/couchbase/following{/other_user}","gists_url":"https://api.github.com/users/couchbase/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbase/subscriptions","organizations_url":"https://api.github.com/users/couchbase/orgs","repos_url":"https://api.github.com/users/couchbase/repos","events_url":"https://api.github.com/users/couchbase/events{/privacy}","received_events_url":"https://api.github.com/users/couchbase/received_events","type":"Organization","site_admin":false},"repo":{"id":9992330,"node_id":"MDEwOlJlcG9zaXRvcnk5OTkyMzMw","name":"couchbase-lite-android","full_name":"couchbase/couchbase-lite-android","private":false,"owner":{"login":"couchbase","id":605755,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwNTc1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/605755?v=4","gravatar_id":"","url":"https://api.github.com/users/couchbase","html_url":"https://github.com/couchbase","followers_url":"https://api.github.com/users/couchbase/followers","following_url":"https://api.github.com/users/couchbase/following{/other_user}","gists_url":"https://api.github.com/users/couchbase/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbase/subscriptions","organizations_url":"https://api.github.com/users/couchbase/orgs","repos_url":"https://api.github.com/users/couchbase/repos","events_url":"https://api.github.com/users/couchbase/events{/privacy}","received_events_url":"https://api.github.com/users/couchbase/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/couchbase/couchbase-lite-android","description":"Lightweight, embedded, syncable NoSQL database engine for Android.","fork":false,"url":"https://api.github.com/repos/couchbase/couchbase-lite-android","forks_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/forks","keys_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/teams","hooks_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/hooks","issue_events_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/events{/number}","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/events","assignees_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/assignees{/user}","branches_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/branches{/branch}","tags_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/tags","blobs_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/statuses/{sha}","languages_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/languages","stargazers_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/stargazers","contributors_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/contributors","subscribers_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/subscribers","subscription_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/subscription","commits_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/contents/{+path}","compare_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/merges","archive_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/downloads","issues_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues{/number}","pulls_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls{/number}","milestones_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/milestones{/number}","notifications_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels{/name}","releases_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/releases{/id}","deployments_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/deployments","created_at":"2013-05-10T23:36:45Z","updated_at":"2018-12-04T09:45:39Z","pushed_at":"2018-12-08T07:43:45Z","git_url":"git://github.com/couchbase/couchbase-lite-android.git","ssh_url":"git@github.com:couchbase/couchbase-lite-android.git","clone_url":"https://github.com/couchbase/couchbase-lite-android.git","svn_url":"https://github.com/couchbase/couchbase-lite-android","homepage":"http://developer.couchbase.com/mobile/","size":74171,"stargazers_count":1068,"watchers_count":1068,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":203,"mirror_url":null,"archived":false,"open_issues_count":116,"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":203,"open_issues":116,"watchers":1068,"default_branch":"master"}},"base":{"label":"couchbase:master","ref":"master","sha":"49d85d44ea952bfd8cd159a25c45f7a9e9b31422","user":{"login":"couchbase","id":605755,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwNTc1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/605755?v=4","gravatar_id":"","url":"https://api.github.com/users/couchbase","html_url":"https://github.com/couchbase","followers_url":"https://api.github.com/users/couchbase/followers","following_url":"https://api.github.com/users/couchbase/following{/other_user}","gists_url":"https://api.github.com/users/couchbase/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbase/subscriptions","organizations_url":"https://api.github.com/users/couchbase/orgs","repos_url":"https://api.github.com/users/couchbase/repos","events_url":"https://api.github.com/users/couchbase/events{/privacy}","received_events_url":"https://api.github.com/users/couchbase/received_events","type":"Organization","site_admin":false},"repo":{"id":9992330,"node_id":"MDEwOlJlcG9zaXRvcnk5OTkyMzMw","name":"couchbase-lite-android","full_name":"couchbase/couchbase-lite-android","private":false,"owner":{"login":"couchbase","id":605755,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwNTc1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/605755?v=4","gravatar_id":"","url":"https://api.github.com/users/couchbase","html_url":"https://github.com/couchbase","followers_url":"https://api.github.com/users/couchbase/followers","following_url":"https://api.github.com/users/couchbase/following{/other_user}","gists_url":"https://api.github.com/users/couchbase/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbase/subscriptions","organizations_url":"https://api.github.com/users/couchbase/orgs","repos_url":"https://api.github.com/users/couchbase/repos","events_url":"https://api.github.com/users/couchbase/events{/privacy}","received_events_url":"https://api.github.com/users/couchbase/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/couchbase/couchbase-lite-android","description":"Lightweight, embedded, syncable NoSQL database engine for Android.","fork":false,"url":"https://api.github.com/repos/couchbase/couchbase-lite-android","forks_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/forks","keys_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/teams","hooks_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/hooks","issue_events_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/events{/number}","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/events","assignees_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/assignees{/user}","branches_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/branches{/branch}","tags_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/tags","blobs_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/statuses/{sha}","languages_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/languages","stargazers_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/stargazers","contributors_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/contributors","subscribers_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/subscribers","subscription_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/subscription","commits_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/contents/{+path}","compare_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/merges","archive_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/downloads","issues_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues{/number}","pulls_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls{/number}","milestones_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/milestones{/number}","notifications_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels{/name}","releases_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/releases{/id}","deployments_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/deployments","created_at":"2013-05-10T23:36:45Z","updated_at":"2018-12-04T09:45:39Z","pushed_at":"2018-12-08T07:43:45Z","git_url":"git://github.com/couchbase/couchbase-lite-android.git","ssh_url":"git@github.com:couchbase/couchbase-lite-android.git","clone_url":"https://github.com/couchbase/couchbase-lite-android.git","svn_url":"https://github.com/couchbase/couchbase-lite-android","homepage":"http://developer.couchbase.com/mobile/","size":74171,"stargazers_count":1068,"watchers_count":1068,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":203,"mirror_url":null,"archived":false,"open_issues_count":116,"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":203,"open_issues":116,"watchers":1068,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/1789"},"html":{"href":"https://github.com/couchbase/couchbase-lite-android/pull/1789"},"issue":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/1789"},"comments":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/1789/comments"},"review_comments":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/1789/comments"},"review_comment":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/pulls/1789/commits"},"statuses":{"href":"https://api.github.com/repos/couchbase/couchbase-lite-android/statuses/25eab1de6e4f2bf3c8c8139e1a6e4a627629295d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pasin"}}