Refresh config ablity #8848
Open
jigar-f wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a new “Refresh Configuration” action that clears the VPN tunnel cache via a new clearTunnelCache API exposed from the Go core through FFI/platform channels and surfaced in the Support screen UI, including localized strings.
Changes:
- Added
clearTunnelCache()to the Dart core service interface and wired it throughLanternServiceto either FFI (desktop) or MethodChannel (mobile). - Implemented
clearTunnelCachein Go core + FFI export and added native platform channel handlers for Android/iOS. - Added a Support screen tile with dialogs/snackbars and English strings for the new user flow.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/lantern/lantern_core_service.dart | Extends the core service interface with clearTunnelCache(). |
| lib/lantern/lantern_service.dart | Routes clearTunnelCache() to FFI vs platform service depending on platform support. |
| lib/lantern/lantern_platform_service.dart | Invokes clearTunnelCache over MethodChannel and maps errors to Failure. |
| lib/lantern/lantern_generated_bindings.dart | Adds the generated FFI binding for the clearTunnelCache native symbol. |
| lib/lantern/lantern_ffi_service.dart | Adds the FFI-backed implementation of clearTunnelCache(). |
| lib/features/support/support.dart | Adds the “Refresh Configuration” UI entry and the user interaction flow. |
| lantern-core/core.go | Adds ClearTunnelCache() to the core API and forwards to the IPC client. |
| lantern-core/ffi/ffi.go | Exports clearTunnelCache for FFI callers. |
| lantern-core/mobile/mobile.go | Adds a mobile wrapper ClearTunnelCache() calling into core. |
| android/app/src/main/kotlin/org/getlantern/lantern/handler/MethodHandler.kt | Adds MethodChannel routing for clearTunnelCache. |
| ios/Runner/Handlers/MethodHandler.swift | Adds MethodChannel routing for clearTunnelCache. |
| assets/locales/en.po | Adds English strings for the new Support screen entry and dialogs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Free the C string returned by clearTunnelCache/runURLTests/sendConfigRequest
in a finally block; toDartString() only converts, so these were leaking the
C.CString("ok") allocation on every call.
- Gate refresh-configuration on `!= VPNStatus.disconnected` so connecting,
disconnecting, missingPermission and error states are also blocked, since
clearing the tunnel cache requires the tunnel to be fully stopped.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 adds a new "Refresh Configuration" feature that allows users to clear the VPN tunnel cache from the support screen in the app. This involves updates across the Flutter UI, platform channels (Android/iOS), and core backend to support the new operation, as well as new user-facing dialogs and translations.
Feature: Refresh Configuration (Clear Tunnel Cache)
Platform Integration
clearTunnelCachemethod in the platform channels for both Android and iOS, wiring up the call from Flutter to the native implementations. [1] [2] [3] [4]Core and FFI Support
ClearTunnelCachemethods to the core Go backend, FFI bindings, and mobile interface, enabling the actual clearing of the tunnel cache. [1] [2] [3] [4]