Zigbee2mqtt bridge state remains offline if broker restarted

My zigbee2mqtt runs on a separate machine to my HA and MQTT broker (mosquitto).

If my HA and mosquitto get restarted, then HA thinks zigbee2mqtt is still offline until I restart it (sensor.zigbee2mqtt_bridge_state = ‘offline’).

zigbee2mqtt’s log says it is reconnected and publishing OK though:

Nov 10 16:37:34 bandicoot bash[44221]: Zigbee2MQTT:error 2022-11-10 16:37:34: Not connected to MQTT server!
Nov 10 16:37:44 bandicoot bash[44221]: Zigbee2MQTT:error 2022-11-10 16:37:44: Not connected to MQTT server!
Nov 10 16:37:54 bandicoot bash[44221]: Zigbee2MQTT:error 2022-11-10 16:37:54: Not connected to MQTT server!
Nov 10 16:38:02 bandicoot bash[44221]: Zigbee2MQTT:info  2022-11-10 16:38:02: Connected to MQTT server

However MQTT (via MQTT Explorer) has zigbee2mqtt/bridge/state = offline.

How do I fix the bridge state when zigbee2mqtt reconnects without restarting it?

As discussed here: Issues when stopping/starting Mosquitto broker · Discussion #12827 · Koenkk/zigbee2mqtt · GitHub , it’s a bug that was thought to be fixed already. I’m testing the latest version now.