Open
Conversation
Contributor
Author
|
Depends on getlantern/radiance#412 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to persist and restore the user’s last-selected VPN server across restarts, while preventing auto-location updates/events from overriding explicit user selections.
Changes:
- Restore persisted server selection on tunnel startup (fallback to auto-connect if none/invalid).
- Add notifier methods for switching to auto mode and updating auto-location metadata.
- Gate handling of
server-locationpush events to avoid overwriting custom selections; small UI state update when switching to Smart Location. - Update Radiance dependency version.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/features/vpn/server_selection.dart | Ensures switching to Smart Location updates provider state before navigating away. |
| lib/features/vpn/provider/server_location_notifier.dart | Adds helper APIs for auto-mode switching and auto-location metadata updates with persistence. |
| lib/features/home/provider/app_event_notifier.dart | Prevents server-location events from overriding non-auto user selections; logging formatting cleanup. |
| lib/features/home/home.dart | Refactors settings tile layout; routing mode tile visibility behavior changes. |
| lantern-core/vpn_tunnel/vpn_tunnel.go | Restores persisted server selection on VPN start, falling back to auto-connect. |
| go.mod | Bumps github.com/getlantern/radiance version. |
| go.sum | Updates checksums for bumped dependency version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request introduces several improvements to the VPN server selection and event handling logic, ensuring that user-selected servers are correctly persisted and restored, and that automatic server updates do not override user choices. It also adds new methods for more granular state management and improves logging and code clarity.
VPN server selection and persistence improvements:
StartVPNinvpn_tunnel.goto restore the user's previously selected server on tunnel startup, falling back to auto-selection only if no prior selection exists. This ensures user choices persist across VPN restarts, especially on Android.server_selection.dart, ensured that switching to auto server selection explicitly updates the state before navigating, preventing stale or inconsistent UI.Event handling enhancements:
AppEventNotifierto processserver-locationevents only when the user is in auto mode, preventing unwanted overrides of custom server selections.app_event_notifier.dartfor better readability and maintainability. [1] [2]State management additions:
updateAutoLocationMetadataandswitchToAutomethods toServerLocationNotifier, allowing for metadata updates and seamless switching to auto mode without losing previous custom server information.Other:
go.modfor thereplacedirective.