Skip to content

Commit 8bcf304

Browse files
bretambroserobertsLando
andauthoredAug 5, 2024··
feat: add unsubscribe ack packet to the unsubscribe callback (#1922)
* Invoke the unsubscribe ack callback with the Unsuback packet, not null * Don't verify incorrect behavior --------- Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>
1 parent 18a357c commit 8bcf304

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/lib/handlers/ack.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const handleAck: PacketHandler = (client, packet) => {
144144
delete client.outgoing[messageId]
145145
client.messageIdProvider.deallocate(messageId)
146146
client['_invokeStoreProcessingQueue']()
147-
cb(null)
147+
cb(null, packet)
148148
break
149149
}
150150
default:

‎test/abstract_client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ export default function abstractTest(server, config, ports) {
19741974
client.once('connect', () => {
19751975
// callback args can be typed
19761976
client.unsubscribe(topic, (_, packet?: mqtt.Packet) => {
1977-
assert.isUndefined(packet)
1977+
assert.isDefined(packet)
19781978
client.end(true, done)
19791979
})
19801980
})

0 commit comments

Comments
 (0)
Please sign in to comment.