{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/comments/44640523","id":44640523,"diff_hunk":"@@ -580,8 +580,17 @@ def postprocess(self, result, action=ACTIONS.READ):\n         # when it's added\n         if action != ACTIONS.READ:\n             # the collection has been changed\n+            if not isinstance(result, list):\n+                result = [result]\n+            impacted = {}\n+            if action == ACTIONS.CREATE:\n+                impacted = [{'new': r} for r in result]\n+            elif action == ACTIONS.DELETE:\n+                impacted = [{'old': r} for r in result]\n+            elif action == ACTIONS.UPDATE:\n+                impacted = [{'new': r, 'old': old} for r in result]","path":"cliquet/resource/__init__.py","position":83,"original_position":83,"commit_id":"cf63f4a370dc3d3548963dbb04e5ca9717a4871d","original_commit_id":"cf63f4a370dc3d3548963dbb04e5ca9717a4871d","user":{"login":"Natim","id":229453,"avatar_url":"https://avatars.githubusercontent.com/u/229453?v=3","gravatar_id":"","url":"https://api.github.com/users/Natim","html_url":"https://github.com/Natim","followers_url":"https://api.github.com/users/Natim/followers","following_url":"https://api.github.com/users/Natim/following{/other_user}","gists_url":"https://api.github.com/users/Natim/gists{/gist_id}","starred_url":"https://api.github.com/users/Natim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Natim/subscriptions","organizations_url":"https://api.github.com/users/Natim/orgs","repos_url":"https://api.github.com/users/Natim/repos","events_url":"https://api.github.com/users/Natim/events{/privacy}","received_events_url":"https://api.github.com/users/Natim/received_events","type":"User","site_admin":false},"body":"But it is something we eventually want with https://github.com/mozilla-services/cliquet/issues/274","created_at":"2015-11-12T10:17:56Z","updated_at":"2015-11-12T10:17:56Z","html_url":"https://github.com/mozilla-services/cliquet/pull/570#discussion_r44640523","pull_request_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/570","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/comments/44640523"},"html":{"href":"https://github.com/mozilla-services/cliquet/pull/570#discussion_r44640523"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/570"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/570","id":50374007,"html_url":"https://github.com/mozilla-services/cliquet/pull/570","diff_url":"https://github.com/mozilla-services/cliquet/pull/570.diff","patch_url":"https://github.com/mozilla-services/cliquet/pull/570.patch","issue_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/570","number":570,"state":"open","locked":false,"title":"Add list of impacted records on ResourceChanged event (fixes #501)","user":{"login":"leplatrem","id":546692,"avatar_url":"https://avatars.githubusercontent.com/u/546692?v=3","gravatar_id":"","url":"https://api.github.com/users/leplatrem","html_url":"https://github.com/leplatrem","followers_url":"https://api.github.com/users/leplatrem/followers","following_url":"https://api.github.com/users/leplatrem/following{/other_user}","gists_url":"https://api.github.com/users/leplatrem/gists{/gist_id}","starred_url":"https://api.github.com/users/leplatrem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leplatrem/subscriptions","organizations_url":"https://api.github.com/users/leplatrem/orgs","repos_url":"https://api.github.com/users/leplatrem/repos","events_url":"https://api.github.com/users/leplatrem/events{/privacy}","received_events_url":"https://api.github.com/users/leplatrem/received_events","type":"User","site_admin":false},"body":"This allowed me to implement a very nice demo of live sync on a map with cliquet-pusher :) \r\n\r\nThis also allows listeners to react on particular field change, since old and new version of records is provided.\r\n\r\nNote: the `permission` attribute is not provided, only the content of `data`.\r\n\r\nQuestion: should the list of impacted records be in the event `payload` attribute instead of being a member?\r\n\r\nThoughts?\r\n","created_at":"2015-11-11T11:33:54Z","updated_at":"2015-11-12T10:17:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72fc0cb797f1f6a6aa369ac06fd2181d8562e655","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/570/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/570/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/570/comments","statuses_url":"https://api.github.com/repos/mozilla-services/cliquet/statuses/cf63f4a370dc3d3548963dbb04e5ca9717a4871d","head":{"label":"mozilla-services:501-impacted-records-events","ref":"501-impacted-records-events","sha":"cf63f4a370dc3d3548963dbb04e5ca9717a4871d","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":30921526,"name":"cliquet","full_name":"mozilla-services/cliquet","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/cliquet","description":"micro services API toolkit","fork":false,"url":"https://api.github.com/repos/mozilla-services/cliquet","forks_url":"https://api.github.com/repos/mozilla-services/cliquet/forks","keys_url":"https://api.github.com/repos/mozilla-services/cliquet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/cliquet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/cliquet/teams","hooks_url":"https://api.github.com/repos/mozilla-services/cliquet/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/cliquet/events","assignees_url":"https://api.github.com/repos/mozilla-services/cliquet/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/cliquet/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/cliquet/tags","blobs_url":"https://api.github.com/repos/mozilla-services/cliquet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/cliquet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/cliquet/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/cliquet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/cliquet/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/cliquet/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/cliquet/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/cliquet/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/cliquet/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/cliquet/subscription","commits_url":"https://api.github.com/repos/mozilla-services/cliquet/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/cliquet/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/cliquet/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/cliquet/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/cliquet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/cliquet/merges","archive_url":"https://api.github.com/repos/mozilla-services/cliquet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/cliquet/downloads","issues_url":"https://api.github.com/repos/mozilla-services/cliquet/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/cliquet/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/cliquet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/cliquet/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/cliquet/releases{/id}","created_at":"2015-02-17T14:53:58Z","updated_at":"2015-11-09T16:49:19Z","pushed_at":"2015-11-12T09:48:25Z","git_url":"git://github.com/mozilla-services/cliquet.git","ssh_url":"git@github.com:mozilla-services/cliquet.git","clone_url":"https://github.com/mozilla-services/cliquet.git","svn_url":"https://github.com/mozilla-services/cliquet","homepage":"http://cliquet.readthedocs.org","size":10114,"stargazers_count":28,"watchers_count":28,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":56,"forks":13,"open_issues":56,"watchers":28,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"beb564510f2aa04cd0714c5bed3e73424a2afa43","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":30921526,"name":"cliquet","full_name":"mozilla-services/cliquet","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/cliquet","description":"micro services API toolkit","fork":false,"url":"https://api.github.com/repos/mozilla-services/cliquet","forks_url":"https://api.github.com/repos/mozilla-services/cliquet/forks","keys_url":"https://api.github.com/repos/mozilla-services/cliquet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/cliquet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/cliquet/teams","hooks_url":"https://api.github.com/repos/mozilla-services/cliquet/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/cliquet/events","assignees_url":"https://api.github.com/repos/mozilla-services/cliquet/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/cliquet/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/cliquet/tags","blobs_url":"https://api.github.com/repos/mozilla-services/cliquet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/cliquet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/cliquet/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/cliquet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/cliquet/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/cliquet/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/cliquet/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/cliquet/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/cliquet/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/cliquet/subscription","commits_url":"https://api.github.com/repos/mozilla-services/cliquet/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/cliquet/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/cliquet/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/cliquet/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/cliquet/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/cliquet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/cliquet/merges","archive_url":"https://api.github.com/repos/mozilla-services/cliquet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/cliquet/downloads","issues_url":"https://api.github.com/repos/mozilla-services/cliquet/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/cliquet/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/cliquet/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/cliquet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/cliquet/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/cliquet/releases{/id}","created_at":"2015-02-17T14:53:58Z","updated_at":"2015-11-09T16:49:19Z","pushed_at":"2015-11-12T09:48:25Z","git_url":"git://github.com/mozilla-services/cliquet.git","ssh_url":"git@github.com:mozilla-services/cliquet.git","clone_url":"https://github.com/mozilla-services/cliquet.git","svn_url":"https://github.com/mozilla-services/cliquet","homepage":"http://cliquet.readthedocs.org","size":10114,"stargazers_count":28,"watchers_count":28,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":56,"forks":13,"open_issues":56,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/570"},"html":{"href":"https://github.com/mozilla-services/cliquet/pull/570"},"issue":{"href":"https://api.github.com/repos/mozilla-services/cliquet/issues/570"},"comments":{"href":"https://api.github.com/repos/mozilla-services/cliquet/issues/570/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/570/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/cliquet/pulls/570/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/cliquet/statuses/cf63f4a370dc3d3548963dbb04e5ca9717a4871d"}}}}