{"action":"created","comment":{"url":"https://api.github.com/repos/mcollina/mosca/pulls/comments/27596748","id":27596748,"diff_hunk":"@@ -52,6 +52,12 @@ AbstractPersistence.prototype.wire = function(server) {\n   server.persistence = this;\n \n   server.storePacket = function(packet, cb) {\n+\n+    // store qos 0 packets only if store_qos0_messages is true\n+    if(packet.qos === 0 && packet.retain === false && ! that.options.store_qos0_messages){\n+      return cb();\n+    }\n+","path":"lib/persistence/abstract.js","position":9,"original_position":9,"commit_id":"66713821b8a373198488975f0e39f0b098ef8999","original_commit_id":"66713821b8a373198488975f0e39f0b098ef8999","user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"body":"you should move this block later in the fuction, otherwise retained messages with QoS 0 will not be stored. It should be after: https://github.com/mazhack/mosca/blob/master/lib/persistence/abstract.js#L67-L70","created_at":"2015-04-01T18:29:23Z","updated_at":"2015-04-01T18:29:23Z","html_url":"https://github.com/mcollina/mosca/pull/230#discussion_r27596748","pull_request_url":"https://api.github.com/repos/mcollina/mosca/pulls/230","_links":{"self":{"href":"https://api.github.com/repos/mcollina/mosca/pulls/comments/27596748"},"html":{"href":"https://github.com/mcollina/mosca/pull/230#discussion_r27596748"},"pull_request":{"href":"https://api.github.com/repos/mcollina/mosca/pulls/230"}}},"pull_request":{"url":"https://api.github.com/repos/mcollina/mosca/pulls/230","id":32269430,"html_url":"https://github.com/mcollina/mosca/pull/230","diff_url":"https://github.com/mcollina/mosca/pull/230.diff","patch_url":"https://github.com/mcollina/mosca/pull/230.patch","issue_url":"https://api.github.com/repos/mcollina/mosca/issues/230","number":230,"state":"open","locked":false,"title":"fix qos 0 messages persistance","user":{"login":"mazhack","id":392629,"avatar_url":"https://avatars.githubusercontent.com/u/392629?v=3","gravatar_id":"","url":"https://api.github.com/users/mazhack","html_url":"https://github.com/mazhack","followers_url":"https://api.github.com/users/mazhack/followers","following_url":"https://api.github.com/users/mazhack/following{/other_user}","gists_url":"https://api.github.com/users/mazhack/gists{/gist_id}","starred_url":"https://api.github.com/users/mazhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mazhack/subscriptions","organizations_url":"https://api.github.com/users/mazhack/orgs","repos_url":"https://api.github.com/users/mazhack/repos","events_url":"https://api.github.com/users/mazhack/events{/privacy}","received_events_url":"https://api.github.com/users/mazhack/received_events","type":"User","site_admin":false},"body":"i try to fix #229","created_at":"2015-03-30T21:28:09Z","updated_at":"2015-04-01T18:29:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fe218f52cea71664003c641b5d034d458ae2198","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mcollina/mosca/pulls/230/commits","review_comments_url":"https://api.github.com/repos/mcollina/mosca/pulls/230/comments","review_comment_url":"https://api.github.com/repos/mcollina/mosca/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mcollina/mosca/issues/230/comments","statuses_url":"https://api.github.com/repos/mcollina/mosca/statuses/66713821b8a373198488975f0e39f0b098ef8999","head":{"label":"mazhack:master","ref":"master","sha":"66713821b8a373198488975f0e39f0b098ef8999","user":{"login":"mazhack","id":392629,"avatar_url":"https://avatars.githubusercontent.com/u/392629?v=3","gravatar_id":"","url":"https://api.github.com/users/mazhack","html_url":"https://github.com/mazhack","followers_url":"https://api.github.com/users/mazhack/followers","following_url":"https://api.github.com/users/mazhack/following{/other_user}","gists_url":"https://api.github.com/users/mazhack/gists{/gist_id}","starred_url":"https://api.github.com/users/mazhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mazhack/subscriptions","organizations_url":"https://api.github.com/users/mazhack/orgs","repos_url":"https://api.github.com/users/mazhack/repos","events_url":"https://api.github.com/users/mazhack/events{/privacy}","received_events_url":"https://api.github.com/users/mazhack/received_events","type":"User","site_admin":false},"repo":{"id":33146006,"name":"mosca","full_name":"mazhack/mosca","owner":{"login":"mazhack","id":392629,"avatar_url":"https://avatars.githubusercontent.com/u/392629?v=3","gravatar_id":"","url":"https://api.github.com/users/mazhack","html_url":"https://github.com/mazhack","followers_url":"https://api.github.com/users/mazhack/followers","following_url":"https://api.github.com/users/mazhack/following{/other_user}","gists_url":"https://api.github.com/users/mazhack/gists{/gist_id}","starred_url":"https://api.github.com/users/mazhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mazhack/subscriptions","organizations_url":"https://api.github.com/users/mazhack/orgs","repos_url":"https://api.github.com/users/mazhack/repos","events_url":"https://api.github.com/users/mazhack/events{/privacy}","received_events_url":"https://api.github.com/users/mazhack/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mazhack/mosca","description":"MQTT broker as a module","fork":true,"url":"https://api.github.com/repos/mazhack/mosca","forks_url":"https://api.github.com/repos/mazhack/mosca/forks","keys_url":"https://api.github.com/repos/mazhack/mosca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mazhack/mosca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mazhack/mosca/teams","hooks_url":"https://api.github.com/repos/mazhack/mosca/hooks","issue_events_url":"https://api.github.com/repos/mazhack/mosca/issues/events{/number}","events_url":"https://api.github.com/repos/mazhack/mosca/events","assignees_url":"https://api.github.com/repos/mazhack/mosca/assignees{/user}","branches_url":"https://api.github.com/repos/mazhack/mosca/branches{/branch}","tags_url":"https://api.github.com/repos/mazhack/mosca/tags","blobs_url":"https://api.github.com/repos/mazhack/mosca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mazhack/mosca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mazhack/mosca/git/refs{/sha}","trees_url":"https://api.github.com/repos/mazhack/mosca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mazhack/mosca/statuses/{sha}","languages_url":"https://api.github.com/repos/mazhack/mosca/languages","stargazers_url":"https://api.github.com/repos/mazhack/mosca/stargazers","contributors_url":"https://api.github.com/repos/mazhack/mosca/contributors","subscribers_url":"https://api.github.com/repos/mazhack/mosca/subscribers","subscription_url":"https://api.github.com/repos/mazhack/mosca/subscription","commits_url":"https://api.github.com/repos/mazhack/mosca/commits{/sha}","git_commits_url":"https://api.github.com/repos/mazhack/mosca/git/commits{/sha}","comments_url":"https://api.github.com/repos/mazhack/mosca/comments{/number}","issue_comment_url":"https://api.github.com/repos/mazhack/mosca/issues/comments{/number}","contents_url":"https://api.github.com/repos/mazhack/mosca/contents/{+path}","compare_url":"https://api.github.com/repos/mazhack/mosca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mazhack/mosca/merges","archive_url":"https://api.github.com/repos/mazhack/mosca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mazhack/mosca/downloads","issues_url":"https://api.github.com/repos/mazhack/mosca/issues{/number}","pulls_url":"https://api.github.com/repos/mazhack/mosca/pulls{/number}","milestones_url":"https://api.github.com/repos/mazhack/mosca/milestones{/number}","notifications_url":"https://api.github.com/repos/mazhack/mosca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mazhack/mosca/labels{/name}","releases_url":"https://api.github.com/repos/mazhack/mosca/releases{/id}","created_at":"2015-03-30T20:23:20Z","updated_at":"2015-03-31T00:11:04Z","pushed_at":"2015-03-31T00:11:04Z","git_url":"git://github.com/mazhack/mosca.git","ssh_url":"git@github.com:mazhack/mosca.git","clone_url":"https://github.com/mazhack/mosca.git","svn_url":"https://github.com/mazhack/mosca","homepage":"mosca.io","size":6598,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mcollina:master","ref":"master","sha":"47690ebacbf5fe3269d1d06bbd83e4819c4eb73b","user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"repo":{"id":8222042,"name":"mosca","full_name":"mcollina/mosca","owner":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mcollina/mosca","description":"MQTT broker as a module","fork":false,"url":"https://api.github.com/repos/mcollina/mosca","forks_url":"https://api.github.com/repos/mcollina/mosca/forks","keys_url":"https://api.github.com/repos/mcollina/mosca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mcollina/mosca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mcollina/mosca/teams","hooks_url":"https://api.github.com/repos/mcollina/mosca/hooks","issue_events_url":"https://api.github.com/repos/mcollina/mosca/issues/events{/number}","events_url":"https://api.github.com/repos/mcollina/mosca/events","assignees_url":"https://api.github.com/repos/mcollina/mosca/assignees{/user}","branches_url":"https://api.github.com/repos/mcollina/mosca/branches{/branch}","tags_url":"https://api.github.com/repos/mcollina/mosca/tags","blobs_url":"https://api.github.com/repos/mcollina/mosca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mcollina/mosca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mcollina/mosca/git/refs{/sha}","trees_url":"https://api.github.com/repos/mcollina/mosca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mcollina/mosca/statuses/{sha}","languages_url":"https://api.github.com/repos/mcollina/mosca/languages","stargazers_url":"https://api.github.com/repos/mcollina/mosca/stargazers","contributors_url":"https://api.github.com/repos/mcollina/mosca/contributors","subscribers_url":"https://api.github.com/repos/mcollina/mosca/subscribers","subscription_url":"https://api.github.com/repos/mcollina/mosca/subscription","commits_url":"https://api.github.com/repos/mcollina/mosca/commits{/sha}","git_commits_url":"https://api.github.com/repos/mcollina/mosca/git/commits{/sha}","comments_url":"https://api.github.com/repos/mcollina/mosca/comments{/number}","issue_comment_url":"https://api.github.com/repos/mcollina/mosca/issues/comments{/number}","contents_url":"https://api.github.com/repos/mcollina/mosca/contents/{+path}","compare_url":"https://api.github.com/repos/mcollina/mosca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mcollina/mosca/merges","archive_url":"https://api.github.com/repos/mcollina/mosca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mcollina/mosca/downloads","issues_url":"https://api.github.com/repos/mcollina/mosca/issues{/number}","pulls_url":"https://api.github.com/repos/mcollina/mosca/pulls{/number}","milestones_url":"https://api.github.com/repos/mcollina/mosca/milestones{/number}","notifications_url":"https://api.github.com/repos/mcollina/mosca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mcollina/mosca/labels{/name}","releases_url":"https://api.github.com/repos/mcollina/mosca/releases{/id}","created_at":"2013-02-15T16:45:20Z","updated_at":"2015-03-28T20:58:33Z","pushed_at":"2015-03-31T00:11:04Z","git_url":"git://github.com/mcollina/mosca.git","ssh_url":"git@github.com:mcollina/mosca.git","clone_url":"https://github.com/mcollina/mosca.git","svn_url":"https://github.com/mcollina/mosca","homepage":"mosca.io","size":9952,"stargazers_count":532,"watchers_count":532,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":103,"mirror_url":null,"open_issues_count":18,"forks":103,"open_issues":18,"watchers":532,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mcollina/mosca/pulls/230"},"html":{"href":"https://github.com/mcollina/mosca/pull/230"},"issue":{"href":"https://api.github.com/repos/mcollina/mosca/issues/230"},"comments":{"href":"https://api.github.com/repos/mcollina/mosca/issues/230/comments"},"review_comments":{"href":"https://api.github.com/repos/mcollina/mosca/pulls/230/comments"},"review_comment":{"href":"https://api.github.com/repos/mcollina/mosca/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mcollina/mosca/pulls/230/commits"},"statuses":{"href":"https://api.github.com/repos/mcollina/mosca/statuses/66713821b8a373198488975f0e39f0b098ef8999"}}}}