Skip to content

fix(mqtt): add resilient ipv4 fallback and retry status UI#37

Open
dbortoluzzi wants to merge 5 commits intoCollektive:mainfrom
dbortoluzzi:fix/clientmqtt-connection
Open

fix(mqtt): add resilient ipv4 fallback and retry status UI#37
dbortoluzzi wants to merge 5 commits intoCollektive:mainfrom
dbortoluzzi:fix/clientmqtt-connection

Conversation

@dbortoluzzi
Copy link

This PR improves MQTT connection robustness on networks where broker.hivemq.com:1883 over IPv6 may fail.

What changed

  • Added automatic fallback to DNS-resolved IPv4 addresses:
    • resolveIpv4Candidates in commonMain (expect)
    • Android implementation (InetAddress.getAllByName + Inet4Address filter)
    • iOS implementation (getaddrinfo + AF_INET filter)
  • Updated MqttMailbox to try hosts in sequence:
    • DNS hostname
    • automatically resolved IPv4 candidates
  • Kept periodic retry logic in the ViewModel without app crashes
  • Added UI feedback message when connection fails and retry is in progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants