Skip to content

fix: retry to get cloud device list until successfully fetching device online state when the network resumes#1555

Merged
SusanPhevos merged 3 commits into
XiaoMi:mainfrom
SusanPhevos:fix-post-error-catch
Dec 16, 2025
Merged

fix: retry to get cloud device list until successfully fetching device online state when the network resumes#1555
SusanPhevos merged 3 commits into
XiaoMi:mainfrom
SusanPhevos:fix-post-error-catch

Conversation

@SusanPhevos

@SusanPhevos SusanPhevos commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Why

In #1519 , after the router restarts, xiaomi_home refreshes the cloud device list when it detects the network to be reconnected to the internet. However, the http post session fails because of "DNS server returned answer with no data" error. User reloads xiaomi_home manually and the http post session succeed. It seems that DNS request is easily to fail soon after the router restarts.
If xiaomi_home does not get the latest device online state from the cloud device list, all the cloud devices will be shown as offline devices whose properties and events would not be subscribed by xiaomi_home. From the cloud service perspective, the brief disconnection of IoT devices caused by a router reboot is not sufficient to classify the devices as offline. The cloud service continues to regard them as online and therefore does not push a “state online” message to xiaomi_home. So the devices are alway unavaible after the router reboot.

Fixed

  • Catch the http post error properly.
  • After the network resumes, keep retrying to fetch the device list until it succeeds.
  • Use constant value to define timer delay.

@SusanPhevos
SusanPhevos merged commit 593d7d3 into XiaoMi:main Dec 16, 2025
6 checks passed
@SusanPhevos
SusanPhevos deleted the fix-post-error-catch branch December 16, 2025 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant