Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add troubleshooting tab and improve extension management#105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
ThomasK33 wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromtroubleshooting-tab-and-extension-management

Conversation

ThomasK33
Copy link
Member

@ThomasK33ThomasK33 commentedMar 10, 2025
edited
Loading

Summary

  • Adds a new Troubleshooting tab in settings for managing VPN extension components
  • Addresses code review feedback by removing custom notifications in favor of direct method calls
  • Improves extension state management and error handling during uninstallation

Test plan

  • Verify Troubleshooting tab shows system extension and network extension status
  • Check extension uninstallation shows appropriate error handling when needed
  • Test reinstallation of extensions works as expected
  • Ensure error presentations are clear and helpful

🤖 Generated withClaude Code

@ThomasK33ThomasK33force-pushed thetroubleshooting-tab-and-extension-management branch 2 times, most recently from960cacf tofed46bdCompareMarch 10, 2025 16:51
Copy link
Member

@ethanndicksonethanndickson left a comment
edited
Loading

Choose a reason for hiding this comment

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

Add "Stop VPN on Quit" setting to control VPN behavior when application closes

I wrote this and it didn't even change it💀

Whilst I am impressed it even compiled, the quality definitely leaves a lot to be desired..

Comment on lines 52 to 58
// Subscribe to reconfiguration requests
NotificationCenter.default.addObserver(
self,
selector: #selector(networkExtensionNeedsReconfiguration(_:)),
name: .networkExtensionNeedsReconfiguration,
object: nil
)

Choose a reason for hiding this comment

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

What's the point of making this a custom event and sending it ourselves? Why wouldn't we just callreconfigure?

Comment on lines +111 to +96
extension NSApplication {
@objc func showLoginWindow() {
NSApp.sendAction(#selector(NSWindowController.showWindow(_:)), to: nil, from: Windows.login.rawValue)
}
}

Choose a reason for hiding this comment

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

Why would we use this over@Environment(\.openWindow)?

@@ -8,7 +8,7 @@ class AppState: ObservableObject {
let appId = Bundle.main.bundleIdentifier!

// Stored in UserDefaults
@Published private(set) var hasSession: Bool {

Choose a reason for hiding this comment

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

Why are we getting rid of this? The whole point is the class maintains the invariant that ifhasSession is true, the auth details exist.

Comment on lines 156 to 157
// A dedicated delegate class for system extension deregistration
private class DeregistrationDelegate: NSObject, OSSystemExtensionRequestDelegate {

Choose a reason for hiding this comment

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

This should just use the existing delegate?

let initialNeState = neState

// Post a notification that the app should reconfigure
NotificationCenter.default.post(name: .networkExtensionNeedsReconfiguration, object: nil)

Choose a reason for hiding this comment

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

This either callsstate.reconfigure or opens the login window. Both things we could do from this function already.

Comment on lines +14 to +11
var sysExtnState: SystemExtensionState { get }
var neState: NetworkExtensionState { get }
Copy link
Member

@ethanndicksonethanndicksonMar 11, 2025
edited
Loading

Choose a reason for hiding this comment

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

I don't think we should expose these, I think it's sufficient to rely on specificVPNServiceStates.

EDIT: It's probably better to, actually, but I wish we didn't :/

Comment on lines 131 to 144
if tunnelState == .connected || tunnelState == .connecting {
await stop()
}

Choose a reason for hiding this comment

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

This just starts the stop operation. It's not complete until thetunnelState changes todisabled.

@@ -1,13 +1,16 @@
import LaunchAtLogin
import SwiftUI

struct GeneralTab: View {
struct GeneralTab<VPN: VPNService>: View {

Choose a reason for hiding this comment

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

Why's this need to be here?

isProcessing = false

if !success {
networkExtensionError = "Failed to enable network extension. Check logs for details."
Copy link
Member

@ethanndicksonethanndicksonMar 11, 2025
edited
Loading

Choose a reason for hiding this comment

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

This isn't a reasonable request on macOS.enableExtension is also not successful if the configuration didn't change, in which case we shouldn't show an error.

- Add troubleshooting tab to settings with system and network extension controls- Address review feedback related to extension management:  - Replace custom notifications with direct method calls for reconfiguration  - Restore proper encapsulation for session state management  - Improve extension uninstallation with proper state monitoring  - Fix deregistration to use existing delegate pattern  - Enhance error handling for network extension operations🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>Change-Id: I947bae1bc7680bd1f670245e4541a95619ab41eeSigned-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33ThomasK33force-pushed thetroubleshooting-tab-and-extension-management branch fromfed46bd to24d5538CompareMarch 11, 2025 05:54
@ThomasK33ThomasK33 marked this pull request as draftMarch 11, 2025 06:57
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ethanndicksonethanndicksonethanndickson requested changes

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ThomasK33@ethanndickson

[8]ページ先頭

©2009-2025 Movatter.jp