Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mqttjs/MQTT.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3.6
Choose a base ref
...
head repository: mqttjs/MQTT.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.3.7
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Mar 14, 2022

  1. fix: fix regression from #1401 and allow CI test failures to break gi…

    …tthub workflow (#1443)
    
    * fix: fix regression from #1401 and allow CI test failures to break github workflow
    
    * temporary rollback to verify break works
    
    * put change back in
    
    * add comment to fix
    
    * fix misspelling
    BertKleewein authored Mar 14, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    accd78e View commit details
Showing with 12 additions and 2 deletions.
  1. +0 −1 .github/workflows/mqttjs-test.yml
  2. +12 −1 lib/client.js
1 change: 0 additions & 1 deletion .github/workflows/mqttjs-test.yml
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@ jobs:
- run: npm ci
- name: Node Tests
run: npm run test:node
continue-on-error: true
env:
CI: true
DEBUG: "mqttjs"
13 changes: 12 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
@@ -1583,7 +1583,18 @@ MqttClient.prototype._handleAck = function (packet) {
const that = this
let err

if (!cb || cb === nop) {
// Checking `!cb` happens to work, but it's not technically "correct".
//
// Why? This code assumes that "no callback" is the same as that "we're not
// waiting for responses" (puback, pubrec, pubcomp, suback, or unsuback).
//
// It would be better to check `if (!this.outgoing[messageId])` here, but
// there's no reason to change it and risk (another) regression.
//
// The only reason this code works is becaues code in MqttClient.publish,
// MqttClinet.subscribe, and MqttClient.unsubscribe ensures that we will
// have a callback even if the user doesn't pass one in.)
if (!cb) {
debug('_handleAck :: Server sent an ack in error. Ignoring.')
// Server sent an ack in error, ignore it.
return