{"action":"created","issue":{"url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/313","labels_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/313/comments","events_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/313/events","html_url":"https://github.com/mqttjs/MQTT.js/issues/313","id":99800541,"number":313,"title":"Mosca/MQTT.js downgrading my QoS request.","user":{"login":"cefn","id":159819,"avatar_url":"https://avatars.githubusercontent.com/u/159819?v=3","gravatar_id":"","url":"https://api.github.com/users/cefn","html_url":"https://github.com/cefn","followers_url":"https://api.github.com/users/cefn/followers","following_url":"https://api.github.com/users/cefn/following{/other_user}","gists_url":"https://api.github.com/users/cefn/gists{/gist_id}","starred_url":"https://api.github.com/users/cefn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cefn/subscriptions","organizations_url":"https://api.github.com/users/cefn/orgs","repos_url":"https://api.github.com/users/cefn/repos","events_url":"https://api.github.com/users/cefn/events{/privacy}","received_events_url":"https://api.github.com/users/cefn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-08T13:00:20Z","updated_at":"2015-08-21T07:09:05Z","closed_at":"2015-08-21T07:09:05Z","body":"QoS granted is less than requested for an unknown reason.\r\n\r\nI'm initiating a subscription deliberately with QoS 2 like this...\r\n\r\n    uplink.subscribe(\"#\", {qos:2}, function(err, granted){\r\n        that.emitter.emit(\"subscribe\", [err,granted]);\r\n    });\r\n\r\n...but the granted array then evaluates as...\r\n\r\n    [{\"topic\":\"#\",\"qos\":1}]\r\n\r\nWhat could be happening which would cause Mosca or my MQTT.js client to downgrade my QoS request. I can't seem to find any indication of this as expected behaviour and it could be problematic to receive multiple notifications after failure for some reason.\r\n\r\nThe client is initiated as...\r\n\r\n    uplink = mqtt.connect(mqttWsAddr);\r\n\r\n...where mqttWsAddr is the websockets URL of the Mosca server launched with the following options...\r\n\r\n```\r\n        var moscaOpts = {\r\n            backend: {},\r\n            logger: {},\r\n            stats: true,\r\n            port:null,\r\n            persistence: {\r\n                factory: persistence.Memory\r\n            },\r\n            http:{\r\n                port:conf.mqttWsPort,\r\n                static:false,\r\n                bundle:false\r\n            },\r\n            onlyHttp:true\r\n        };\r\n```"},"comment":{"url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/comments/133312203","html_url":"https://github.com/mqttjs/MQTT.js/issues/313#issuecomment-133312203","issue_url":"https://api.github.com/repos/mqttjs/MQTT.js/issues/313","id":133312203,"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},"created_at":"2015-08-21T07:09:05Z","updated_at":"2015-08-21T07:09:05Z","body":"Mosca only supports QoS 1, it's stated in the README."}}