Skip to content

Macos system extension updates #2#8637

Merged
myleshorton merged 5 commits intomainfrom
jigar/macos-sys
Apr 10, 2026
Merged

Macos system extension updates #2#8637
myleshorton merged 5 commits intomainfrom
jigar/macos-sys

Conversation

@jigar-f
Copy link
Copy Markdown
Contributor

@jigar-f jigar-f commented Apr 10, 2026

This pull request includes several changes across CI workflows, macOS extension state management, and the system extension reconciliation logic. The main goals are to streamline caching in CI, improve the accuracy of macOS extension status handling, and refine the logic for reconciling system extension states, especially when dealing with uninstalling extensions.

CI Workflow Improvements:

  • Removed .dart_tool from the cache paths in all workflow files (build-android.yml, build-linux.yml, build-macos.yml, build-windows.yml) and ensured only ~/.pub-cache is cached, which should reduce cache size and avoid unnecessary cache invalidation. ([[1]](https://github.com/getlantern/lantern/pull/8637/files#diff-990269d44b14b14a290b6d577fde890babb7b7f98e88f9e33753db2d5fca4570L47), [[2]](https://github.com/getlantern/lantern/pull/8637/files#diff-990269d44b14b14a290b6d577fde890babb7b7f98e88f9e33753db2d5fca4570L104), [[3]](https://github.com/getlantern/lantern/pull/8637/files#diff-bfc3aeacfea5c320a79818465fb6d4b9901e2c1fc26af712702cae54db219bdcL56), [[4]](https://github.com/getlantern/lantern/pull/8637/files#diff-a1654f4357833dfc4d0c6a8d39c2e3ee30ceea604c29238846903993434ab384L49), [[5]](https://github.com/getlantern/lantern/pull/8637/files#diff-01d393d5fc96ff0e19c736f6b445df76a62887b81071928a950e936379746f2dL58))
  • In build-ios.yml, replaced .dart_tool with ~/.pub-cache in the cache path for consistency with other platforms. ([.github/workflows/build-ios.ymlL55-R55](https://github.com/getlantern/lantern/pull/8637/files#diff-c75570ad4e0fdfe6f209247388e447fb5bcca0d45461735d9211e0f971beb406L55-R55))

macOS Extension State Management:

  • Changed the default state for MacOSExtensionState from notInstalled to unknown to better reflect the initial state before status is determined. ([[1]](https://github.com/getlantern/lantern/pull/8637/files#diff-775ff7db23dca67ed061eed2e38459a20aadd0324ed9c259665c0b262ec59617L25-R25), [[2]](https://github.com/getlantern/lantern/pull/8637/files#diff-03faae1021be7e1189ff7cefc9374af69a34ec9c16e8da99f29922389f974b9fL21-R21))
  • Updated logic in VpnStatus to treat the unknown status as not ready and to prevent certain UI actions if the extension status is unknown. ([lib/features/vpn/vpn_status.dartR78-R80](https://github.com/getlantern/lantern/pull/8637/files#diff-03faae1021be7e1189ff7cefc9374af69a34ec9c16e8da99f29922389f974b9fR78-R80))
  • Removed the display of non-error extension status messages from the MacOSExtensionDialog UI for a cleaner user experience. ([lib/features/macos_extension/macos_extension_dialog.dartL82-L95](https://github.com/getlantern/lantern/pull/8637/files#diff-805a5ba0a3facf797739dc375d663ba01257478e0011c6eca6ae90a8a2284a7dL82-L95))

System Extension Reconciliation Logic:

  • Refined the reconciliation logic in SystemExtensionManager.swift to handle cases where an enabled extension is uninstalling but its contents differ from the bundled version, allowing normal upgrade/content-change handling instead of blocking on a reboot. ([macos/Runner/VPN/SystemExtensionManager.swiftL578-R578](https://github.com/getlantern/lantern/pull/8637/files#diff-3c337cbd9892c03a95394ca9b8a870b55b1a83c5925c0ecc0c7f8042620f2ca2L578-R578))
  • Updated the corresponding test to verify that the reconciliation process now triggers a content change and appropriate actions, rather than requiring a reboot. ([[1]](https://github.com/getlantern/lantern/pull/8637/files#diff-c8d0858157e18aeeae5bca9ab00aa55061c93d358aa6e9b85f106e6186e3c91dL183-R183), [[2]](https://github.com/getlantern/lantern/pull/8637/files#diff-c8d0858157e18aeeae5bca9ab00aa55061c93d358aa6e9b85f106e6186e3c91dL197-L201))

@jigar-f jigar-f marked this pull request as ready for review April 10, 2026 11:58
Copilot AI review requested due to automatic review settings April 10, 2026 11:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates CI caching and refines macOS system extension state/reconciliation behavior to reduce unnecessary “reboot required” states and better represent “unknown” extension status before it’s determined.

Changes:

  • Simplifies GitHub Actions caching by removing .dart_tool from cache paths and standardizing on ~/.pub-cache.
  • Updates macOS extension state initialization to default to unknown and adjusts UI gating/visibility around that state.
  • Refines macOS system extension reconciliation to allow normal upgrade/content-change handling when an enabled extension is uninstalling but differs from the bundled copy, and updates tests accordingly.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
macos/Runner/VPN/SystemExtensionManager.swift Adjusts reconciliation flow to avoid blocking on reboot for certain uninstalling/mismatch scenarios.
macos/RunnerTests/RunnerTests.swift Updates test expectations to validate content-change reconciliation behavior instead of reboot requirement.
lib/features/vpn/vpn_status.dart Changes default extension state to unknown and adds unknown-specific gating logic.
lib/features/macos_extension/provider/macos_extension_notifier.dart Initializes provider state to unknown instead of notInstalled.
lib/features/macos_extension/macos_extension_dialog.dart Removes non-error status message rendering from the dialog UI.
.github/workflows/build-android.yml Removes .dart_tool from cache paths.
.github/workflows/build-linux.yml Removes .dart_tool from cache paths.
.github/workflows/build-macos.yml Removes .dart_tool from cache paths and trims restore-key formatting.
.github/workflows/build-windows.yml Removes .dart_tool from cache paths.
.github/workflows/build-ios.yml Switches cache path to ~/.pub-cache (and now differs slightly in formatting vs. others).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread macos/Runner/VPN/SystemExtensionManager.swift Outdated
Comment thread lib/features/vpn/vpn_status.dart
Comment thread .github/workflows/build-ios.yml
@jigar-f jigar-f self-assigned this Apr 10, 2026
@jigar-f jigar-f requested review from atavism and myleshorton April 10, 2026 12:47
action: .activate(reason: "activate bundled extension while old version awaits removal"),
change: .install)
}
return SystemExtensionReconciliation(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change

@myleshorton myleshorton merged commit ed66f54 into main Apr 10, 2026
8 checks passed
@myleshorton myleshorton deleted the jigar/macos-sys branch April 10, 2026 15:07
garmr-ulfr pushed a commit that referenced this pull request Apr 14, 2026
* if system extension is in uninstall state do not block new installtion.

* update macos system extension test

* do not cache dart_tool

* Set the default status as unknown.

* code review updates
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