Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a cross-platform “tag availability” check so the app can avoid attempting to connect to a server tag that no longer exists, falling back to auto-connect instead.
Changes:
- Introduces
isTagAvailable(tag)onLanternCoreServiceand implements it via MethodChannel (mobile) and FFI (desktop/FFI-supported platforms). - Wires
VpnNotifierto check tag availability before connecting to a specific server and fall back to auto VPN when unavailable. - Updates Go VPN start logic to use
vpn.AutoConnect("")and exposes tag availability in Go mobile + FFI layers.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| macos/Runner/Handlers/MethodHandler.swift | Adds MethodChannel handler for isTagAvailable calling into MobileIsTagAvailable. |
| ios/Runner/Handlers/MethodHandler.swift | Adds MethodChannel handler for isTagAvailable calling into MobileIsTagAvailable. |
| android/app/src/main/kotlin/org/getlantern/lantern/handler/MethodHandler.kt | Adds isTagAvailable method handling and calls into Mobile.isTagAvailable. |
| lib/lantern/lantern_core_service.dart | Adds new isTagAvailable API to the shared service interface. |
| lib/lantern/lantern_service.dart | Routes isTagAvailable to FFI vs platform implementations based on support. |
| lib/lantern/lantern_platform_service.dart | Implements isTagAvailable over MethodChannel with fail-open behavior. |
| lib/lantern/lantern_generated_bindings.dart | Adds generated binding for isTagAvailable FFI symbol. |
| lib/lantern/lantern_ffi_service.dart | Implements isTagAvailable via FFI in a background worker. |
| lib/features/vpn/provider/vpn_notifier.dart | Uses isTagAvailable before connecting to a specific tag; falls back to auto. |
| lantern-core/vpn_tunnel/vpn_tunnel.go | Switches start VPN path from QuickConnect to AutoConnect. |
| lantern-core/mobile/mobile.go | Exposes IsTagAvailable to gomobile consumers. |
| lantern-core/ffi/ffi.go | Exposes isTagAvailable to Dart FFI consumers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
android/app/src/main/kotlin/org/getlantern/lantern/handler/MethodHandler.kt
Outdated
Show resolved
Hide resolved
android/app/src/main/kotlin/org/getlantern/lantern/handler/MethodHandler.kt
Outdated
Show resolved
Hide resolved
Contributor
Author
|
I am testing few more things on this. |
* Update radiance + lantern-box for bandit distributed tracing (#8566) - radiance: picks up lantern-box v0.0.51 - lantern-box v0.0.51: propagates traceparent from bandit callback URLs, enabling contiguous distributed tracing across the feedback loop Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * System tray changes (#8568) * added back sys tray changes * server location changes * add flags only on desktop versions. * code review updates (#8569) * Update lantern_platform_service.dart --------- Co-authored-by: atavism <atavism@users.noreply.github.com> * Update radiance with bandit callback fixes (#8570) Picks up: - Pre-test uses live network config (not stale disk config) - updateGroup fires SetURLOverrides + CheckOutbounds on repeat configs - Pre-test timeout 5s → 15s for proxy callback tests Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * code review updates --------- Co-authored-by: Myles Horton <afisk@getlantern.org> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: jigar-f <132374182+jigar-f@users.noreply.github.com>
6d50b5f to
7794eaa
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 5 comments.
💡 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 a new feature that checks if a VPN server tag is available before attempting to connect, improving reliability by avoiding connection attempts to unavailable servers. The change is implemented across the core Go backend, FFI bindings, platform channels (Android, iOS, macOS), and Dart service layers. Additionally, the VPN connection logic in the Flutter app is updated to use this check and fall back to auto-connect if the tag is not available. Minor refactoring is also included in the VPN notifier for improved readability.
New server tag availability check:
isTagAvailablefunction to the Go core (lantern-core/ffi/ffi.go,lantern-core/mobile/mobile.go) to check if a server tag exists, with a fail-open approach if the check cannot be performed. [1] [2]MethodHandler.kt), iOS (MethodHandler.swift), and macOS (MethodHandler.swift). [1] [2] [3] [4] [5] [6] [7]isTagAvailablemethod in Dart service layers:LanternFFIService,LanternPlatformService, andLanternService, and added it to theLanternCoreServiceinterface. [1] [2] [3] [4]VPN connection logic improvements:
VpnNotifierto check server tag availability before connecting; if unavailable, it falls back to auto VPN connection, preventing failed connection attempts to non-existent servers.VpnNotifierfor cleaner provider listening logic. [1] [2]Other backend update:
AutoConnectinstead ofQuickConnect, aligning with the new fallback behavior.