Skip to content

Commit

Permalink
feat: add unsubscribe ack packet to the unsubscribe callback (#1922)
Browse files Browse the repository at this point in the history
* Invoke the unsubscribe ack callback with the Unsuback packet, not null

* Don't verify incorrect behavior

---------

Co-authored-by: Daniel Lando <[email protected]>
  • Loading branch information
bretambrose and robertsLando authored Aug 5, 2024
1 parent 18a357c commit 8bcf304
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/handlers/ack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const handleAck: PacketHandler = (client, packet) => {
delete client.outgoing[messageId]
client.messageIdProvider.deallocate(messageId)
client['_invokeStoreProcessingQueue']()
cb(null)
cb(null, packet)
break
}
default:
Expand Down
2 changes: 1 addition & 1 deletion test/abstract_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@ export default function abstractTest(server, config, ports) {
client.once('connect', () => {
// callback args can be typed
client.unsubscribe(topic, (_, packet?: mqtt.Packet) => {
assert.isUndefined(packet)
assert.isDefined(packet)
client.end(true, done)
})
})
Expand Down

0 comments on commit 8bcf304

Please sign in to comment.