Packages

mqtt

5.16.1 · 14 Oct 2026MIT4.6M / weekRepositoryHomepagenpmAtom feed

Upgrading mqtt From 4.3.8 to 5.16.1

60 releases in betweenevery note read

  1. 4.3.8yours
  2. 5.0.0major
  3. 18 releases
  4. 5.3.5security
  5. 38 releases
  6. 5.16.0security
  7. 5.16.1target

Before you upgrade

Tick each one off as you go
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0

Security

  • options is no longer mutated by a CONNACK. Code that read negotiated values back off options.properties.maximumPacketSize or options.keepalive must use the new client.serverProperties / client.keepalive getters instead.

    5.16.0
  • A refused CONNACK now always closes the socket. With reconnectOnConnackError: false (the default) the client previously sat on an open connection and kept delivering message events after telling the application the connection was refused.

    5.16.0
  • Protocol violations now drop the connection: a SUBACK reason-code count mismatch, an invalid Topic Alias, an unsolicited or out-of-spec AUTH, and a broker exceeding receiveMaximum on inbound QoS 2 (reason code 0x93). Reconnect stays armed in all cases.

    5.16.0
  • An ack that does not answer the command pending on that message id is dropped and reported via error, instead of running the wrong completion path.

    5.16.0
  • The unregistered-alias case now emits reason code 0x82 (Protocol Error) instead of 0x94.

    5.16.0
  • AUTH reason code 0 ends the exchange successfully; previously it produced an error with an empty reason string.

    5.16.0
  • properties.receiveMaximum outside 1..65535, or not an integer, is ignored and 65535 is enforced and advertised instead.

    5.16.0
  • The inbound packet-size cap now measures total wire size rather than Remaining Length, so it triggers on packets a few bytes smaller than before.

    5.16.0
  • New exports: PacketPump (src/lib/shared.ts), PendingCommand from the entry point.

    5.16.0
  • bounds-check the suback granted array against subscriptions sent (GHSA-rj8f-4655-cgg2) (#2061) (46ee23f), closes #2060

    5.16.0

Release by release

  1. 5.16.1

    14 Oct 20262 fixes
    • Fixed

      Reconnect instead of ending a client whose stream is already destroyed

    • Fixed

      Schedule browser process.nextTick with queueMicrotask (#2056) (648b79c), closes #2074

  2. 5.16.0

    Security fix16 Sep 2026
    • Security

      options is no longer mutated by a CONNACK. Code that read negotiated values back off options.properties.maximumPacketSize or options.keepalive must use the new client.serverProperties / client.keepalive getters instead.

    • Security

      A refused CONNACK now always closes the socket. With reconnectOnConnackError: false (the default) the client previously sat on an open connection and kept delivering message events after telling the application the connection was refused.

    • Security

      Protocol violations now drop the connection: a SUBACK reason-code count mismatch, an invalid Topic Alias, an unsolicited or out-of-spec AUTH, and a broker exceeding receiveMaximum on inbound QoS 2 (reason code 0x93). Reconnect stays armed in all cases.

    • Security

      An ack that does not answer the command pending on that message id is dropped and reported via error, instead of running the wrong completion path.

  3. 5.15.2

    6 Jul 20262 fixes
    • Fixed

      connect/tls: don't overwrite an explicit servername (SNI)

    • Fixed

      Support relative WebSocket URLs (#2049) (c4be563), closes #2035

  4. 5.15.1nothing new or fixed in the note

  5. 5.15.0

    2 Feb 20261 new
    • New

      Exported topic validation functions for external use (#2036) 396e02a, closes #2036

  6. 5.14.1

    4 Sep 20252 fixes
    • Fixed

      connect/ws: ensure proxy stream is writable (#2024) (fe45405), closes #1914

    • Fixed

      isWebWorkerEnv check for Deno environment

  7. 5.13.3 – 5.14.02 releases, nothing new or fixed in the notes

  8. 5.13.2

    7 Jul 20251 fix
5 other lines we could not sort, mostly version bumps
  • Create an util class BufferedDuplex to replace duplexify on ws ali and wx

    5.3.0
  • Partially fixes #876 (will keep this for another PR)

    5.3.0
  • Improve types in ws. Use window.WebSocket for Browser and ws module types for Node

    5.3.0
  • Significatly reduces bundle size by ~24% (90kB)

    5.3.0
  • Improved browser tests to subscribe to different topics to prevent false positives when running concurrently

    5.3.0

9 internal lines (docs, tests, tooling) left out.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.