Skip to content

Refresh config ablity #8848

Open
jigar-f wants to merge 4 commits into
mainfrom
jigar/rulset-fetch
Open

Refresh config ablity #8848
jigar-f wants to merge 4 commits into
mainfrom
jigar/rulset-fetch

Conversation

@jigar-f

@jigar-f jigar-f commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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)

  • Added a "Refresh Configuration" option to the support screen UI, including user dialogs for success and error cases, and checks to ensure the VPN is disconnected before clearing configuration. [1] [2] [3]
  • Added new localized strings for the refresh configuration feature and its dialogs.

Platform Integration

  • Implemented the clearTunnelCache method 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

  • Added ClearTunnelCache methods to the core Go backend, FFI bindings, and mobile interface, enabling the actual clearing of the tunnel cache. [1] [2] [3] [4]
  • Exposed the new method through the Dart FFI and platform service layers, and updated the main service interface to support it. [1] [2] [3] [4] [5]

Copilot AI review requested due to automatic review settings June 9, 2026 13:10
@jigar-f jigar-f self-assigned this Jun 9, 2026

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

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 through LanternService to either FFI (desktop) or MethodChannel (mobile).
  • Implemented clearTunnelCache in 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.

Comment thread lib/lantern/lantern_ffi_service.dart
Comment thread lib/features/support/support.dart Outdated
jigar-f and others added 2 commits June 9, 2026 18:52
- 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>
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.

2 participants