fix: disable MQTT autoReconnect to prevent connection flickering on resume
| .. | .. |
|---|
| 440 | 440 | ); |
|---|
| 441 | 441 | _mqttLog('MQTT: connect result=${result?.state}'); |
|---|
| 442 | 442 | if (result?.state == MqttConnectionState.connected) { |
|---|
| 443 | | - client.autoReconnect = true; // Now enable auto-reconnect for the live connection |
|---|
| 443 | + // Don't enable autoReconnect — we handle reconnection ourselves |
|---|
| 444 | + // in didChangeAppLifecycleState(resumed). The library's autoReconnect |
|---|
| 445 | + // competes with our force-reconnect and causes connection flickering. |
|---|
| 444 | 446 | return true; |
|---|
| 445 | 447 | } |
|---|
| 446 | 448 | _client = null; |
|---|