Skip to content

Warn before pinning unreachable manual servers#8833

Merged
atavism merged 22 commits into
mainfrom
atavism/manual-server
Jun 18, 2026
Merged

Warn before pinning unreachable manual servers#8833
atavism merged 22 commits into
mainfrom
atavism/manual-server

Conversation

@atavism

@atavism atavism commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Resolves https://github.com/getlantern/engineering/issues/3550

  • Surface manual-selection risk when a Lantern server has no successful Smart Location probe
  • Warn before pinning traffic to a likely unreachable manual server
  • Let users either try the selected server anyway or switch back to Smart Location
  • Add model tests for fastest-server selection and manual warning behavior

Copilot AI review requested due to automatic review settings June 2, 2026 23:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 hasSuccessfulProbe and shouldWarnBeforeManualSelection to 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.

Comment thread assets/locales/en.po
Comment thread lib/features/vpn/provider/available_servers_notifier.dart Outdated
@atavism atavism requested a review from jigar-f June 15, 2026 13:51
jigar-f and others added 8 commits June 15, 2026 20:39
* 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>
@atavism

atavism commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Pulling all this in now

@atavism atavism merged commit fc84cbe into main Jun 18, 2026
8 checks passed
@atavism atavism deleted the atavism/manual-server branch June 18, 2026 15:15
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.

5 participants