From 8bcf3042a9133acf8d266d73bc67153a69660e05 Mon Sep 17 00:00:00 2001 From: Bret Ambrose Date: Mon, 5 Aug 2024 02:58:08 -0700 Subject: [PATCH] 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 --- src/lib/handlers/ack.ts | 2 +- test/abstract_client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/handlers/ack.ts b/src/lib/handlers/ack.ts index 83f902966..45851686c 100644 --- a/src/lib/handlers/ack.ts +++ b/src/lib/handlers/ack.ts @@ -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: diff --git a/test/abstract_client.ts b/test/abstract_client.ts index d4441318a..effa9ac54 100644 --- a/test/abstract_client.ts +++ b/test/abstract_client.ts @@ -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) }) })