ESPHome keeps an ESP32 from losing retained MQTT messages when it connects with many subscriptions. These messages hold the broker’s last saved value. A busy startup could previously overflow the incoming queue, leaving switches and message-triggered automations without their saved state until another message arrived.

On an ESP32-C3 test with 25 message topics and 15 switch-command topics, the correction delivered every retained message across 28 boots using a nearby access point. Very broad wildcard subscriptions or unusually large messages can still overflow the queue.