Problem
wifi_credentials_test() treats any Wi-Fi connection failure during pending firmware verification as bad credentials and immediately rolls back. This can rollback good firmware during temporary Wi-Fi outage, slow DHCP, weak signal, or AP startup delay.
Even thought it is fair to expect the new firmware to be able to connect to WiFi just half a second after the previous firmware successfully connected to WiFi to download the update, it is worth to try to make the wifi_credentials_test more reliable.
Expected behavior
Rollback should happen only when the device has strong evidence that the new firmware contains bad Wi-Fi credentials.
Suggested fix
Add retries/backoff, increase validation time, or distinguish transient Wi-Fi failures from credential failures before calling esp_ota_mark_app_invalid_rollback_and_reboot().
Problem
wifi_credentials_test() treats any Wi-Fi connection failure during pending firmware verification as bad credentials and immediately rolls back. This can rollback good firmware during temporary Wi-Fi outage, slow DHCP, weak signal, or AP startup delay.
Even thought it is fair to expect the new firmware to be able to connect to WiFi just half a second after the previous firmware successfully connected to WiFi to download the update, it is worth to try to make the wifi_credentials_test more reliable.
Expected behavior
Rollback should happen only when the device has strong evidence that the new firmware contains bad Wi-Fi credentials.
Suggested fix
Add retries/backoff, increase validation time, or distinguish transient Wi-Fi failures from credential failures before calling esp_ota_mark_app_invalid_rollback_and_reboot().