macOS fix for tunnel cache#8871
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds macOS MethodChannel support and Dart FFI bindings to trigger a native “clear tunnel cache” operation (plus related settings/env/config helpers), aligning Flutter-side calls with the existing native/mobile APIs.
Changes:
- Wire up a new
"clearTunnelCache"Flutter method inmacos/Runner/Handlers/MethodHandler.swiftthat callsMobileClearTunnelCacheand returns"ok"or a FlutterError. - Regenerate/adjust Dart FFI bindings in
lantern_generated_bindings.dartto exposeclearTunnelCacheand related settings/env/config/test functions, and remove duplicate definitions. - Rename
loadInstalledAppIconparameters (appPath/iconPath→appPathC/iconPathC) for clarity.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| macos/Runner/Handlers/MethodHandler.swift | Adds a new MethodChannel case + handler method to clear tunnel cache via MobileClearTunnelCache. |
| lib/lantern/lantern_generated_bindings.dart | Exposes new/relocated FFI symbol lookups (including clearTunnelCache) and applies a small parameter rename. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
LGTM! |
atavism
approved these changes
Jun 18, 2026
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 primarily adds and wires up support for clearing the tunnel cache via both Dart FFI bindings and the macOS method handler. It also includes a minor parameter renaming for clarity. The most important changes are outlined below.
Dart FFI Bindings Updates:
LanternBindingsinlantern_generated_bindings.dartfor patching and retrieving settings/environment variables, running URL tests, updating config, and specifically for clearing the tunnel cache. These methods provide Dart-side access to native functionality.macOS Method Handler Integration:
"clearTunnelCache"case to the Flutter method channel switch inMethodHandler.swift, allowing the Flutter app to invoke this functionality.clearTunnelCachemethod inMethodHandler, which calls the nativeMobileClearTunnelCachefunction asynchronously and returns the result or handles errors appropriately.Minor Refactor:
loadInstalledAppIconmethod fromappPath/iconPathtoappPathC/iconPathCfor improved clarity and consistency.