Warn before pinning unreachable manual servers#8833
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds UX + model support to warn users before pinning to a manually selected Lantern server that likely won’t work (no successful Smart Location probe), while tightening server selection logic to only consider successful probes.
Changes:
- Add
hasSuccessfulProbeandshouldWarnBeforeManualSelectionto server models and update “fastest server” selection to only use successful probes. - Surface reachability warnings in the server selection UI (subtitle/icon) and gate manual selection behind a warning dialog with “Try Anyway” vs “Use Smart Location”.
- Add unit tests covering fastest-server selection and manual warning behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/core/models/available_servers_test.dart | Adds model tests for fastest-server selection and manual warning conditions. |
| lib/features/vpn/single_city_server_view.dart | Replaces subtitle rendering with shared reachability subtitle + warning icon. |
| lib/features/vpn/server_selection.dart | Adds manual-selection warning dialog flow; wires reachability subtitle/icon into list tiles; minor cleanup. |
| lib/features/vpn/server_reachability.dart | New shared UI helpers for reachability subtitle and warning icon/tooltip. |
| lib/features/vpn/location_setting.dart | Surfaces reachability warning in the Location setting tile when pinned to an unprobed Lantern server. |
| lib/core/models/available_servers.dart | Adds serverByTag, probe-success helpers, and tightens fastestLanternServer filtering. |
| assets/locales/en.po | Adds English strings for the new reachability warning UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jigar-f
reviewed
Jun 9, 2026
This reverts commit 00b6258.
# Conflicts: # go.mod # go.sum
* server selection: distinguish "testing" from "unreachable" During Smart Location convergence the url-test probe cycle takes several minutes to visit every server. Until a server is probed it has no selection history, so `Server.hasSuccessfulProbe` is false — and the UI treated "no successful probe" as a single state, bucketing every not-yet-probed server into the "Currently Unavailable" section with a "may be unreachable" warning. A mid-convergence snapshot therefore read as "many servers unreachable" when the probes were simply still running (Freshdesk #178551). Split the collapsed `!hasSuccessfulProbe` state into four, using the backend's `consecutive_failures` (a uint, unambiguous under omitempty, unlike the time.Time `last_outcome_at` zero value): - reachable lastSuccessDelayMs > 0 -> normal row - awaiting probe no verdict yet -> "testing" - flapping 1..2 failures, no success -> normal row - probed & failing >= 3 failures, no success -> warn The >= 3 threshold (consteq _manualSelectionFailureWarningThreshold) follows atavism's reverted "Treat untested servers as unknown" approach: a single transient probe failure shouldn't brand a server unreachable. `shouldWarnBeforeManualSelection` now means probed-and-sustained-failing only, so the section split, per-row warning icon, and pre-selection dialog all stop firing for untested servers automatically. Untested rows show a neutral "testing" spinner (new ServerTestingIndicator). The per-location representative prefers a still-testing server, then any not-yet-unreachable server, over a failed one — so a location reads as unavailable only once all of its servers have sustained failures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Treat sustained probe failures as unreachable (#8874) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: atavism <atavism@users.noreply.github.com>
Contributor
Author
|
Pulling all this in now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves https://github.com/getlantern/engineering/issues/3550