Skip to content

macOS fix for tunnel cache#8871

Merged
atavism merged 3 commits into
mainfrom
jigar/clear-cache-macos
Jun 18, 2026
Merged

macOS fix for tunnel cache#8871
atavism merged 3 commits into
mainfrom
jigar/clear-cache-macos

Conversation

@jigar-f

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

Copy link
Copy Markdown
Contributor

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:

  • Added new FFI methods to LanternBindings in lantern_generated_bindings.dart for 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.
  • Removed duplicate or misplaced definitions of these FFI methods from the end of the class, consolidating them in a single location for clarity and maintainability.

macOS Method Handler Integration:

  • Added a new "clearTunnelCache" case to the Flutter method channel switch in MethodHandler.swift, allowing the Flutter app to invoke this functionality.
  • Implemented the clearTunnelCache method in MethodHandler, which calls the native MobileClearTunnelCache function asynchronously and returns the result or handles errors appropriately.

Minor Refactor:

  • Renamed parameters in the loadInstalledAppIcon method from appPath/iconPath to appPathC/iconPathC for improved clarity and consistency.

@jigar-f jigar-f requested a review from Copilot June 17, 2026 15:06
@jigar-f jigar-f self-assigned this Jun 17, 2026
@jigar-f jigar-f requested a review from atavism June 17, 2026 15:07

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

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 in macos/Runner/Handlers/MethodHandler.swift that calls MobileClearTunnelCache and returns "ok" or a FlutterError.
  • Regenerate/adjust Dart FFI bindings in lantern_generated_bindings.dart to expose clearTunnelCache and related settings/env/config/test functions, and remove duplicate definitions.
  • Rename loadInstalledAppIcon parameters (appPath/iconPathappPathC/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.

@atavism

atavism commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

LGTM!

@atavism atavism merged commit 71fffd0 into main Jun 18, 2026
8 checks passed
@atavism atavism deleted the jigar/clear-cache-macos branch June 18, 2026 14:44
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.

3 participants