Skip to content

Fix quick wins from xcode warnings list#4977

Merged
bgoncal merged 10 commits into
mainfrom
xcode-recommendations-3
Jul 8, 2026
Merged

Fix quick wins from xcode warnings list#4977
bgoncal merged 10 commits into
mainfrom
xcode-recommendations-3

Conversation

@bgoncal

@bgoncal bgoncal commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Screenshots

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

claude and others added 6 commits July 7, 2026 17:16
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
@bgoncal bgoncal self-assigned this Jul 7, 2026
@bgoncal bgoncal added the scout label Jul 7, 2026
Base automatically changed from xcode-recommendations-2 to main July 8, 2026 11:12
@bgoncal

bgoncal commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request also fix lint issues

Copilot AI review requested due to automatic review settings July 8, 2026 11:19
@bgoncal bgoncal removed the request for review from Copilot July 8, 2026 11:19

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request also fix lint issues

Merged main into the branch and resolved the three merge conflicts:

  • QuickActionWindowSceneDelegate.swift: Adopted the activeURLUsingLastKnownNetworkState() approach from main (landed via Remove deprecated sync activeURL() and make SSID/hardware-address access async #4953 "Remove deprecated sync activeURL()").
  • ConnectivityWrapper.swift: Adopted the async observeConnectivityChanges() pattern from main, removing the old syncNetworkInformation method.
  • WatchApp/Info.plist: Restored CLKComplicationSupportedFamilies that was present in main.

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>
Copilot AI review requested due to automatic review settings July 8, 2026 11:43
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ SwiftLint disabled in this PR

The following added lines contain // swiftlint:disable. Please verify this is necessary.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Unused L10n strings detected

Found 2 unused localization strings in the codebase.

Click to see details
Parsing Strings.swift...
Found 1876 L10n strings

Reading all Swift source code...
Read 6325858 characters of Swift code

Checking for unused strings...
Checked 100/1876 strings...
Checked 200/1876 strings...
Checked 300/1876 strings...
Checked 400/1876 strings...
Checked 500/1876 strings...
Checked 600/1876 strings...
Checked 700/1876 strings...
Checked 800/1876 strings...
Checked 900/1876 strings...
Checked 1000/1876 strings...
Checked 1100/1876 strings...
Checked 1200/1876 strings...
Checked 1300/1876 strings...
Checked 1400/1876 strings...
Checked 1500/1876 strings...
Checked 1600/1876 strings...
Checked 1700/1876 strings...
Checked 1800/1876 strings...

================================================================================
UNUSED STRINGS REPORT
================================================================================

Found 2 unused strings:


CONNECTION:
  - L10n.Connection.Permission.InternalUrl.body1
    Key: connection.permission.internal_url.body1
    Line: 1362
  - L10n.Connection.Permission.InternalUrl.body2
    Key: connection.permission.internal_url.body2
    Line: 1364

================================================================================
Total unused: 2
================================================================================

================================================================================
Copy-paste these keys into the "Lokalise: Delete Keys" workflow (keys input):
================================================================================
connection.permission.internal_url.body1,connection.permission.internal_url.body2

To remove them, run the
Lokalise: Delete Keys
workflow — it deletes the keys from Lokalise and opens a PR removing them from
Localizable.strings and regenerating Strings.swift. Copy-paste these keys into the keys input:

connection.permission.internal_url.body1,connection.permission.internal_url.body2

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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/CoreServices to UniformTypeIdentifiers, and updates related attachment/file handling.
  • Applies concurrency-warning mitigations (e.g., @preconcurrency import, @unchecked Sendable, unfair-lock usage, @Sendable closures) and modern async AVFoundation property loading.
  • Improves SF Symbol handling by moving toast symbols from String to SFSafeSymbols.SFSymbol and updating rendering to use systemSymbol APIs.

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.

Comment thread Sources/Shared/Toast/DynamicIslandToast/ToastView.swift
Comment thread HomeAssistant.xcodeproj/project.pbxproj
Comment thread .swiftlint.yml
…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

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.71795% with 20 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@18b64ea). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...tionAttachments/NotificationAttachmentParser.swift 21.42% 11 Missing ⚠️
...red/API/Webhook/Alamofire+EncryptedResponses.swift 0.00% 2 Missing ⚠️
...ources/Shared/Toast/DynamicIslandToast/Toast.swift 0.00% 2 Missing ⚠️
Sources/Shared/API/Models/NotificationAction.swift 0.00% 1 Missing ⚠️
...urces/Shared/API/Models/NotificationCategory.swift 0.00% 1 Missing ⚠️
...es/Shared/Common/Extensions/XCGLogger+Export.swift 0.00% 1 Missing ⚠️
...s/Shared/Intents/GetCameraImageIntentHandler.swift 0.00% 1 Missing ⚠️
...es/Shared/Toast/DynamicIslandToast/ToastView.swift 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bgoncal bgoncal merged commit 2158b7d into main Jul 8, 2026
15 checks passed
@bgoncal bgoncal deleted the xcode-recommendations-3 branch July 8, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants