Skip to content

Conversation

thisisabhash
Copy link
Member

@thisisabhash thisisabhash commented Aug 19, 2025

Issue #

None

Description

This PR contains changes for resolving build warnings for following experimental features introduced in Swift 6:

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@thisisabhash thisisabhash marked this pull request as ready for review August 21, 2025 16:48
@thisisabhash thisisabhash requested a review from a team as a code owner August 21, 2025 16:48
Copy link

@Copilot Copilot AI left a comment

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 build warnings for Swift 6 experimental features by resolving strict concurrency checking issues throughout the Amplify Swift codebase.

  • Adds @preconcurrency imports to suppress concurrency warnings for modules not yet fully concurrency-safe
  • Changes mutable static properties to immutable (var to let) where appropriate
  • Adds @unchecked Sendable conformance to classes that are inherently thread-safe but don't formally conform to Sendable

Reviewed Changes

Copilot reviewed 249 out of 249 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
AmplifyTests/CoreTests/*.swift Added @preconcurrency imports and @unchecked Sendable conformances for test classes
AmplifyTestCommon/Models/**/*.swift Added @preconcurrency import Amplify throughout model schema files
AmplifyPlugins/**/*.swift Added @preconcurrency imports for Combine, Amplify, and other modules; changed static var to let
AmplifyPlugins/Auth/Sources/**/*.swift Added @unchecked Sendable conformances and nonisolated(unsafe) for static properties
AmplifyPlugins/API/Sources/**/*.swift Updated generic constraints to include Sendable requirements for Decodable types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

codecov bot commented Aug 25, 2025

Codecov Report

❌ Patch coverage is 52.94118% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.79%. Comparing base (5866f82) to head (2be494b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...gin/Sync/InitialSync/InitialSyncOrchestrator.swift 0.00% 5 Missing ⚠️
...ies/DataStore/Subscribe/MutationEvent+Schema.swift 0.00% 1 Missing ⚠️
...uthPlugin/AWSCognitoAuthPlugin+AppSyncSigner.swift 0.00% 1 Missing ⚠️
...s/AWSCognitoAuthPlugin/Environment/IDFactory.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4041      +/-   ##
==========================================
- Coverage   67.80%   67.79%   -0.02%     
==========================================
  Files        1129     1129              
  Lines       52478    52482       +4     
==========================================
- Hits        35585    35578       -7     
- Misses      16893    16904      +11     
Flag Coverage Δ
API_plugin_unit_test 70.33% <100.00%> (ø)
AWSPluginsCore 69.25% <ø> (ø)
Amplify 47.93% <66.66%> (-0.02%) ⬇️
Analytics_plugin_unit_test 85.20% <ø> (ø)
Auth_plugin_unit_test 73.63% <0.00%> (+0.03%) ⬆️
DataStore_plugin_unit_test 83.33% <0.00%> (-0.16%) ⬇️
Geo_plugin_unit_test 74.86% <ø> (ø)
Logging_plugin_unit_test 65.27% <ø> (ø)
Predictions_plugin_unit_test 34.77% <ø> (ø)
PushNotifications_plugin_unit_test 88.43% <ø> (ø)
Storage_plugin_unit_test 79.39% <ø> (ø)
unit_tests 67.79% <52.94%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@thisisabhash
Copy link
Member Author

@thisisabhash thisisabhash merged commit 1d60201 into main Aug 26, 2025
292 of 306 checks passed
@thisisabhash thisisabhash deleted the chore/build-for-swift-6-experimental-features branch August 26, 2025 18:11
ekjotmultani pushed a commit that referenced this pull request Sep 3, 2025
…4041)

* chore(build): fix build warnings for swift 6 experimental features

* chore: add @unchecked Sendable conformances and nonisolated modifiers

* chore: fix swiftlint errors

* chore: add  @preconcurrency attribute for module imports

* chore: add more preconcurrency attributes

* chore: add preconcurrency to model generated files

* chore: fix failing unit test

* chore: revert ActivityTracker changes

* chore: update EndpointResolving

* chore: resolve swiftlint error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants