Skip to content

draft: Warn user when DNS is not working - #4414

Draft
nicoschmdt wants to merge 2 commits into
bluerobotics:masterfrom
nicoschmdt:warn-dns
Draft

draft: Warn user when DNS is not working#4414
nicoschmdt wants to merge 2 commits into
bluerobotics:masterfrom
nicoschmdt:warn-dns

Conversation

@nicoschmdt

Copy link
Copy Markdown
Collaborator

fix: #690

@nicoschmdt
nicoschmdt marked this pull request as draft September 4, 2026 20:12
@nicoschmdt
nicoschmdt marked this pull request as ready for review September 4, 2026 20:14
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: MINOR SUGGESTIONS ✏️

Adds a DNS-failure warning path to the internet-status tray. Backend helper service now surfaces socket.gaierror as a dns sentinel on WebsiteStatus.error; the frontend store derives a dns_failure flag from the mix of IP-only and named probes and, when true, swaps the tray icon/tooltip and deep-links the network-interface menu to the DNS configuration tab on open.

1. Correctness & Implementation Bugs

  • 1.1 [minor] core/frontend/src/store/helper.ts:108-119 — when every IP-based probe times out (ip_sites.length === 0) the first branch is skipped, and if link_up is also false the second branch is skipped too, leaving a previously-true dns_failure stuck on forever until an IP probe answers again. In today's Website enum only Cloudflare is IP-based, so a single hiccup at 1.1.1.1 freezes the DNS warning. Consider also clearing dns_failure when every decided named site is online regardless of IP probe presence — that's a strong positive signal that DNS is working.
  • 1.2 [minor] core/frontend/src/components/app/NetworkInterfaceMenu.vue:61-66mounted() reads initialPage once. If the parent re-passes a different value while the modal is open (e.g. dns_failure flips), the tab won't move. Today v-if="show_menu" on the parent means the component is recreated on each open so this is fine in practice, but a watch on initialPage (or using it as a computed default for page_selected) is more robust and matches Vue reactivity expectations.

6. Code Quality & Style

  • 6.1 [nit] core/frontend/src/components/app/InternetTrayMenu.vue:58-83 — the new dns_failure computed is defined but the tooltip and icon computed properties still reach for helper.dns_failure directly. Pick one style; using this.dns_failure throughout removes the double reference and is consistent with the rest of the file's use of computed indirection.
  • 6.2 [nit] core/services/helper/main.py:461 and core/frontend/src/store/helper.ts:116 — the literal "dns" is now a cross-service protocol string (alongside "timeout"). Consider promoting both to a shared enum-ish constant on each side (WebsiteErrorSentinel.DNS = "dns") so a rename on one side is caught by the other. Minor since there are only two values today.

7. Tests

  • 7.1 [minor] No pytest coverage for the new dns_error propagation in SimpleHttpResponse / check_website, and no unit coverage for the store's DNS classification logic in checkInternetAccess. The classification branches (IP-only down, mixed named results, all-named-dns, all-named-online) are the interesting ones to lock down; a small test that constructs a fake SiteStatus payload and asserts dns_failure/has_internet transitions would be cheap insurance.

8. Documentation

  • 8.1 [nit] PR title still starts with draft: even though isDraft is false. Drop the prefix before merge so the squash-commit subject reads cleanly.
  • 8.2 [nit] core/services/helper/main.py:460 — the comment "Sentinel, like the 'timeout' one set by check_internet_access" is helpful, but the twin sentinel is set in check_internet_access on line 499 of the same file; a # see also: check_internet_access reference (or the shared constant from 6.2) makes the coupling harder to miss.

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

@nicoschmdt
nicoschmdt marked this pull request as draft September 4, 2026 20:18
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.

Core: Version-chooser: Temporary failure in name resolution

1 participant