Fix quick wins from xcode warnings list#4977
Conversation
PR #4968 moved Realm from CocoaPods to SPM. The fork's Package.swift declares the Realm/RealmSwift library products as explicitly dynamic, and Xcode fails to embed such plain dynamic package frameworks into archived/exported builds. The resulting TestFlight build crashes in dyld on every launch: Termination Reason: DYLD 1 Library missing Library not loaded: @rpath/RealmSwift.framework/RealmSwift Debug/simulator runs don't catch this because dyld resolves the framework from the build products directory via rpath. Mark RealmSwift as Embed & Sign (copy files phase, Frameworks destination) on the App target and the watch extension, the same way the CocoaPods-built Realm dynamic framework used to ship. The iOS app extensions pick up the app-embedded copy through their existing @executable_path/../../Frameworks runpath. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PJLzNatPzGYpw9mGwJhpJK
Matches the attribute convention of the existing Embed Frameworks entries (Shared.framework). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PJLzNatPzGYpw9mGwJhpJK
|
@copilot resolve the merge conflicts in this pull request also fix lint issues |
Merged
Merge commit: dd09cd8 |
Keep the regex on a folded block scalar so the over-long line is a single unbreakable word (allowed by yamllint) instead of a quoted one-liner that trips the 120-char limit. Value is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The following added lines contain |
|
Found 2 unused localization strings in the codebase. Click to see detailsTo remove them, run the |
There was a problem hiding this comment.
Pull request overview
This PR addresses a broad set of Xcode warning “quick wins” across the iOS app and extensions by updating API usages (UTType / AVFoundation async loads), tightening concurrency annotations, and modernizing some SwiftUI / WidgetKit / Watch complications code paths.
Changes:
- Migrates various deprecated type identifiers from
MobileCoreServices/CoreServicestoUniformTypeIdentifiers, and updates related attachment/file handling. - Applies concurrency-warning mitigations (e.g.,
@preconcurrency import,@unchecked Sendable, unfair-lock usage,@Sendableclosures) and modern async AVFoundation property loading. - Improves SF Symbol handling by moving toast symbols from
StringtoSFSafeSymbols.SFSymboland updating rendering to usesystemSymbolAPIs.
Reviewed changes
Copilot reviewed 76 out of 76 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/Shared/Toast/ToastPresenter.swift | Changes toast API to accept SFSymbol instead of String and imports SFSafeSymbols. |
| Sources/Shared/Toast/DynamicIslandToast/ToastView.swift | Updates toast symbol rendering to Image(systemSymbol:). |
| Sources/Shared/Toast/DynamicIslandToast/Toast.swift | Migrates toast model symbol from String to SFSymbol and updates examples. |
| Sources/Shared/Notifications/NotificationCommands/NotificationsCommandManager.swift | Uses @preconcurrency import PromiseKit to silence concurrency warnings. |
| Sources/Shared/Notifications/NotificationAttachments/NotificationAttachmentParserCamera.swift | Migrates JPEG type hint to UTType identifier. |
| Sources/Shared/Notifications/NotificationAttachments/NotificationAttachmentParser.swift | Migrates content-type mapping to UTType and updates return handling. |
| Sources/Shared/Notifications/NotificationAttachments/NotificationAttachmentManager.swift | Migrates PNG type hint to UTType identifier and tweaks PromiseKit capture usage. |
| Sources/Shared/Intents/GetCameraImageIntentHandler.swift | Migrates PNG UTI usage to UTType.png.identifier. |
| Sources/Shared/Extensions/Color+Codable.swift | Switches to @retroactive Decodable/Encodable conformances. |
| Sources/Shared/Environment/Environment.swift | Replaces atomic flag with OSAllocatedUnfairLock for one-time Current setup. |
| Sources/Shared/Common/Extensions/XCGLogger+Export.swift | Updates ZipFoundation archive creation to try? throwing initializer. |
| Sources/Shared/Common/Extensions/CLKComplication+Strings.swift | Refactors complication template creation to initializer-based APIs. |
| Sources/Shared/API/Webhook/Networking/WebhookManager.swift | Adjusts capture semantics while cleaning up background-session bookkeeping. |
| Sources/Shared/API/Webhook/Networking/CustomServerTrustManager.swift | Marks trust manager @unchecked Sendable to satisfy concurrency warnings. |
| Sources/Shared/API/Webhook/Alamofire+EncryptedResponses.swift | Simplifies JSON extraction and marks response serializers @unchecked Sendable. |
| Sources/Shared/API/mTLS/ClientCertificateSessionDelegate.swift | Marks session delegate @unchecked Sendable. |
| Sources/Shared/API/Models/WatchComplication.swift | Refactors complication templates to initializer-based APIs and simplifies nil-guard flows. |
| Sources/Shared/API/Models/NotificationCategory.swift | Moves Identifiable conformance to the Shared model type. |
| Sources/Shared/API/Models/NotificationAction.swift | Moves Identifiable conformance to the Shared model type. |
| Sources/Shared/API/Models/LegacyModelManager.swift | Marks cleanup definition @unchecked Sendable with a clarifying comment. |
| Sources/Shared/API/MJPEGStreamer.swift | Marks delegates @unchecked Sendable and uses @Sendable completion handlers. |
| Sources/Shared/API/ConnectionInfo.swift | Makes request adapter final and @unchecked Sendable. |
| Sources/Shared/API/Authentication/TokenManager.swift | Makes TokenManager final and @unchecked Sendable. |
| Sources/Shared/API/Authentication/AuthenticationAPI.swift | Uses @preconcurrency import PromiseKit and marks onboarding delegate @unchecked Sendable. |
| Sources/Extensions/Widgets/TodoList/WidgetTodoListView.swift | Adds explicit WidgetKit import. |
| Sources/Extensions/Widgets/Script/Control/ControlScriptsValueProvider.swift | Adjusts availability annotations to @available(iOS 18, *). |
| Sources/Extensions/Widgets/Script/Control/ControlScript.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Scene/SceneAppIntent.swift | Marks AppIntent @unchecked Sendable. |
| Sources/Extensions/Widgets/Scene/Control/ControlScenesValueProvider.swift | Adjusts availability annotations to @available(iOS 18, *). |
| Sources/Extensions/Widgets/Scene/Control/ControlScene.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/OpenPage/Control/ControlOpenPage.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Controls/Switch/ControlSwitch.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Controls/OpenEntity/ControlOpenEntity/ControlOpenEntity.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Controls/OpenEntity/ControlOpenCamera/ControlOpenCamera.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Controls/Light/ControlLight.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Controls/Fan/ControlFan.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Controls/Cover/ControlCover.swift | Adds SwiftLint suppression for runtime-picked SF Symbols (label + valueLabel). |
| Sources/Extensions/Widgets/Controls/Button/ControlButton.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Controls/Automation/ControlAutomationsValueProvider.swift | Adjusts availability annotations to @available(iOS 18, *). |
| Sources/Extensions/Widgets/Controls/Automation/ControlAutomation.swift | Adds SwiftLint suppression for runtime-picked SF Symbols. |
| Sources/Extensions/Widgets/Controls/Automation/AutomationAppIntent.swift | Marks AppIntent @unchecked Sendable. |
| Sources/Extensions/Widgets/Common/WidgetFamilySizes.swift | Adds handling for .systemExtraLargePortrait. |
| Sources/Extensions/Widgets/Common/WidgetBasicViewTintedWrapper.swift | Adds explicit WidgetKit import. |
| Sources/Extensions/Widgets/Common/WidgetBasicSensorView.swift | Adds explicit WidgetKit import. |
| Sources/Extensions/Widgets/Common/WidgetBasicButtonView.swift | Adds explicit WidgetKit import. |
| Sources/Extensions/Widgets/Assist/WidgetAssistViewTintedWrapper.swift | Adds explicit WidgetKit import. |
| Sources/Extensions/Widgets/Assist/WidgetAssistView.swift | Adds explicit WidgetKit import. |
| Sources/Extensions/Watch/Resources/Info.plist | Removes CLKComplicationSupportedFamilies from the Watch extension plist. |
| Sources/Extensions/Watch/Complication/Assist/AssistDefaultComplication.swift | Fixes bezel template initialization requiring a circular template. |
| Sources/Extensions/NotificationContent/MapViewController.swift | Migrates from MKPinAnnotationView to MKMarkerAnnotationView. |
| Sources/Extensions/NotificationContent/ImageAttachmentViewController.swift | Migrates UTI handling to UTType and updates GIF detection and MIME type lookup. |
| Sources/Extensions/NotificationContent/CameraViewController.swift | Refactors PromiseKit recovery chain to reduce capture warnings and clarify controller configuration. |
| Sources/Extensions/NotificationContent/CameraStreamHLSViewController.swift | Updates to async AVAssetTrack.load(.naturalSize) for track sizing. |
| Sources/Extensions/AppIntents/Script/ScriptAppIntent.swift | Marks AppIntent @unchecked Sendable. |
| Sources/App/Settings/Notifications/NotificationSoundsView.swift | Moves duration checks to async AVFoundation loads and reuses static enumeration helper. |
| Sources/App/Settings/Notifications/NotificationCategoryListView.swift | Removes local Identifiable extension now moved to Shared model. |
| Sources/App/Settings/Notifications/NotificationCategoryEditorView.swift | Removes local Identifiable extension now moved to Shared model. |
| Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift | Switches to @Environment(\.requestReview) instead of SKStoreReviewController.requestReview(). |
| Sources/App/Settings/AboutView.swift | Updates language code lookup to newer Locale API. |
| Sources/App/Scenes/CarPlaySceneDelegate.swift | Updates GRDB observation tracking closure to explicit db parameter style. |
| Sources/App/Onboarding/Views/OnboardingErrorView.swift | Avoids passing nil archive URL into share sheet by compact-mapping. |
| Sources/App/Onboarding/API/OnboardingAuthStepClientCertificate.swift | Simplifies capture list when importing client certificates during onboarding. |
| Sources/App/Notifications/NotificationManagerLocalPushInterfaceExtension.swift | Adds weak self capture to PerServerContainer constructor closure. |
| Sources/App/Notifications/NotificationManager.swift | Adjusts PromiseKit capture to avoid retaining self and updates toast symbol type usage. |
| Sources/App/Frontend/IncomingURLHandler.swift | Uses connectedScenes iteration when destroying scenes on Catalyst. |
| Sources/App/Frontend/ExternalMessageBus/WebViewExternalMessageHandler.swift | Minor refactors (local const for result, toast symbol update, payload typing tweak). |
| Sources/App/Frontend/Extensions/WebViewGestureHandler.swift | Adds .cauterize() to ignore unused Promise return. |
| Sources/App/Frontend/DownloadManager/DownloadManagerViewModel.swift | Ensures progress updates are applied on the MainActor. |
| Sources/App/Frontend/DownloadManager/DownloadManagerView.swift | Guards symbolEffect usage behind iOS 18 and extracts checkmark view builder. |
| Sources/App/Frontend/ConnectivityCheck/ConnectivityChecker.swift | Uses OSAllocatedUnfairLock to ensure continuation resumes exactly once and silences memcpy warning. |
| Sources/App/ClientEvents/LocationHistoryDetailViewController.swift | Migrates from pin annotations to marker annotations. |
| Sources/App/BarcodeScanner/Camera/BarcodeScannerViewModel.swift | Adds .cauterize() to ignore unused Promise returns. |
| Sources/App/BarcodeScanner/Camera/BarcodeScannerCamera.swift | Marks camera object @unchecked Sendable. |
| Sources/App/Assist/Local/SpeechSynthesizer.swift | Marks synthesizer @unchecked Sendable. |
| HomeAssistant.xcodeproj/project.pbxproj | Updates project structure/build settings and adds new framework build file references. |
| .swiftlint.yml | Updates custom rule regex formatting and anchors. |
…tion - Import SFSafeSymbols in ToastView.swift so Image(systemSymbol:) resolves now that Toast.symbol is an SFSymbol. - Reset project.pbxproj to main: the merge had duplicated framework/resource/ source build files, left a dangling Colors.xcassets reference, and reintroduced the CodeSignOnCopy embed that caused the Tests-App build cycle. This PR adds no new files, so no project changes are needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4977 +/- ##
=======================================
Coverage ? 52.02%
=======================================
Files ? 298
Lines ? 19610
Branches ? 0
=======================================
Hits ? 10203
Misses ? 9407
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes