Move OpenURLAction to OpenSwiftUICore and update system handling - #954
Conversation
|
👀 Human Input Needed → Pair Review Briefing |
🤖 Augment PR SummarySummary: Moves SwiftUI-style URL opening behavior into Changes:
Technical Notes: Core-only environments now safely discard URLs when no system handler is configured, while OpenSwiftUI-configured environments resolve to glue-provided system routing. 🤖 Was this summary useful? React with 👍 or 👎 |
| let endpoint = scene.perform(selector) { | ||
| configuration.targetConnectionEndpoint = endpoint.takeUnretainedValue() | ||
| } | ||
| guard let workspace = LSApplicationWorkspace.default() else { |
There was a problem hiding this comment.
defaultOpenSensitiveURLAction can exit without calling completion (e.g., when LSApplicationWorkspace.default() is nil, and also in the non-iOS/visionOS #else branch), which can leave callers waiting indefinitely; consider always invoking completion(false) on these paths.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| case let .systemAction(urlOverride): | ||
| guard let fallback else { | ||
| Log.internalWarning("OpenURLAction configured without a fallback") | ||
| return |
There was a problem hiding this comment.
When a custom action returns .systemAction but fallback is nil, this path returns without invoking completion, so direct OpenURLAction { .systemAction } use or a core-only environment leaves callers of openURL(url) { ... } waiting indefinitely instead of reporting failure. Other locations where this applies: Sources/OpenSwiftUI/Util/OpenSwiftUIGlue.swift lines 125 and 139.
Severity: medium
🤖 Was this useful? React with 👍 or 👎
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #954 +/- ##
==========================================
+ Coverage 26.56% 26.65% +0.08%
==========================================
Files 732 731 -1
Lines 52699 52737 +38
==========================================
+ Hits 14002 14059 +57
+ Misses 38697 38678 -19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
OpenURLAction, its environment storage, and related tests intoOpenSwiftUICore.CoreGlue, allowing OpenSwiftUI to provide scene-aware platform routing and sensitive URL handling where supported..systemActionresults.Impact
This separates core URL action behavior from platform-specific dispatch while keeping environment resolution consistent. Core-only environments now discard URLs safely when no system action is available, while configured OpenSwiftUI environments use the appropriate platform handler and provide predictable results to custom actions.