Files
MeshCoreTel-firmware/src/helpers
Valentin V. Bartenev 59f6df50c5 Web: replace unreliable post-OTA device poll with a countdown timer
After a successful OTA upload the web panel polled the device by
fetching "/" and waiting for a 200 OK response.  This approach
is fundamentally broken when the new firmware contains a freshly
generated self-signed certificate (e.g. from a clean CI build):

- The browser rejects the TLS handshake with a certificate error
  (MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT in Firefox; other browsers
  report different error names but behave identically).  The fetch()
  call throws a generic TypeError — the same type thrown for any other
  network failure such as a refused or timed-out connection.  Browsers
  intentionally provide no way to distinguish a cert rejection from a
  plain connectivity failure, so the catch block cannot tell whether
  the device is up-but-cert-changed or simply not yet online.

- Switching to an explicit http:// URL to sidestep TLS is not an
  option: the web panel is served over HTTPS, and browsers block
  active mixed content (fetch/XHR to HTTP) unconditionally from an
  HTTPS origin.

Because no network-based probe can reliably detect device readiness
under these constraints without changing how the certificate is
generated, replace the polling loop with a simple 10-second countdown
timer that unconditionally redirects to the login page.  The device
is typically back online within ~7 seconds, so the 10-second wait
provides a reasonable safety margin.
2026-05-16 01:51:06 +03:00
..
2025-12-02 10:31:24 +00:00
2025-06-25 11:00:24 +02:00
2026-03-20 15:56:09 +08:00
2026-04-17 17:54:47 +10:00
2025-06-30 03:46:18 +02:00
2026-02-18 22:32:01 +07:00
2026-04-18 21:32:41 +10:00
2026-04-17 14:38:03 +10:00