Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Zero MessageID when QoS > 0 #251

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ pids
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
# Coverage directory used by tools like nyc
coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
Expand Down
2 changes: 1 addition & 1 deletion lib/qos-packet.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function QoSPacket (original, client) {
if (!original.messageId) {
this.messageId = client._nextId
if (client._nextId === 65535) {
client._nextId = 0
client._nextId = 1
} else {
client._nextId++
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"typescript-test": "npm run typescript-compile-test && npm run typescript-compile-execute",
"test": "tape test/*.js test/*/*.js | faucet",
"ci": "npm run lint && npm run typescript-test && npm run coverage",
"coverage": "istanbul cover tape test/*.js test/*/*.js",
"coverage": "nyc --reporter=lcov tape test/*.js test/*/*.js",
"coveralls": "cat coverage/lcov.info | coveralls"
},
"pre-commit": [
Expand Down Expand Up @@ -46,9 +46,9 @@
"coveralls": "^3.0.4",
"duplexify": "^4.1.1",
"faucet": "0.0.1",
"istanbul": "^0.4.5",
"mqtt": "^3.0.0",
"mqtt-connection": "^4.0.0",
"nyc": "^14.1.1",
"pre-commit": "^1.2.2",
"standard": "^12.0.1",
"tape": "^4.10.2",
Expand Down
4 changes: 2 additions & 2 deletions test/keep-alive.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ test('disconnect if a connect does not arrive in time', function (t) {
t.timeoutAfter(200)

var s = setup(aedes({
connectTimeout: 50
connectTimeout: 100
}))
var start = Date.now()

eos(s.conn, function () {
t.ok(Date.now() >= start + 50, 'waits waitConnectTimeout before ending')
t.ok(Date.now() >= start + 100, 'waits waitConnectTimeout before ending')
t.pass('ended')
})
})