Skip to content

Commit 912a721

Browse files
committed
Merge branch 'hotfix/0.33.7'
2 parents 9ff8a1c + 9ac79f9 commit 912a721

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

Core/Sources/HostApp/DebugView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ final class DebugSettings: ObservableObject {
2929
var observeToAXNotificationWithDefaultMode
3030
@AppStorage(\.useCloudflareDomainNameForLicenseCheck)
3131
var useCloudflareDomainNameForLicenseCheck
32+
@AppStorage(\.doNotInstallLaunchAgentAutomatically)
33+
var doNotInstallLaunchAgentAutomatically
3234
init() {}
3335
}
3436

@@ -136,6 +138,12 @@ struct DebugSettingsView: View {
136138
Text("Use Cloudflare domain name for license check")
137139
}
138140

141+
Toggle(
142+
isOn: $settings.doNotInstallLaunchAgentAutomatically
143+
) {
144+
Text("Don't install launch agent automatically")
145+
}
146+
139147
Button("Reset update cycle") {
140148
updateChecker.resetUpdateCycle()
141149
}

Core/Sources/HostApp/General.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ struct General {
3232
switch action {
3333
case .appear:
3434
return .run { send in
35+
if UserDefaults.shared.value(for: \.doNotInstallLaunchAgentAutomatically) {
36+
return
37+
}
3538
await send(.setupLaunchAgentIfNeeded)
3639
}
3740

Tool/Sources/Preferences/Keys.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,5 +748,9 @@ public extension UserDefaultPreferenceKeys {
748748
var useCloudflareDomainNameForLicenseCheck: FeatureFlag {
749749
.init(defaultValue: false, key: "FeatureFlag-UseCloudflareDomainNameForLicenseCheck")
750750
}
751+
752+
var doNotInstallLaunchAgentAutomatically: FeatureFlag {
753+
.init(defaultValue: false, key: "FeatureFlag-DoNotInstallLaunchAgentAutomatically")
754+
}
751755
}
752756

Tool/Sources/XPCShared/XPCService.swift

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class XPCService {
1717
let interface: NSXPCInterface
1818
let logger: Logger
1919
weak var delegate: XPCServiceDelegate?
20-
20+
2121
@XPCServiceActor
2222
private var isInvalidated = false
2323

@@ -101,6 +101,12 @@ private class InvalidatingConnection {
101101

102102
struct NoDataError: Error {}
103103

104+
struct EmptyResponseError: Error, LocalizedError {
105+
var errorDescription: String? {
106+
"The server is not returning a response. The app may be installed in the wrong directory."
107+
}
108+
}
109+
104110
struct AutoFinishContinuation<T> {
105111
var continuation: AsyncThrowingStream<T, Error>.Continuation
106112

@@ -129,7 +135,10 @@ func withXPCServiceConnected<T, P>(
129135
} as! P
130136
fn(service, .init(continuation: continuation))
131137
}
132-
return try await stream.first(where: { _ in true })!
138+
guard let result = try await stream.first(where: { _ in true }) else {
139+
throw EmptyResponseError()
140+
}
141+
return result
133142
}
134143

135144
@XPCServiceActor
@@ -144,9 +153,12 @@ public func testXPCListenerEndpoint(_ endpoint: NSXPCListenerEndpoint) async ->
144153
continuation.finish()
145154
}
146155
do {
147-
try await stream.first(where: { _ in true })!
156+
guard let _ = try await stream.first(where: { _ in true }) else {
157+
throw EmptyResponseError()
158+
}
148159
return true
149160
} catch {
150161
return false
151162
}
152163
}
164+

Version.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_VERSION = 0.33.7
2-
APP_BUILD = 398
2+
APP_BUILD = 399
33

0 commit comments

Comments
 (0)