Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add @mainactor attribute to DeviceInfo #3712

Conversation

phantumcode
Copy link
Member

@phantumcode phantumcode commented May 20, 2024

Issue #

Description

UIDevice is marked with @MainActor attribute resulting in errors when calling it from synchronous non-isolated context.
Resolve strict concurrency error by updating DeviceInfo and calling UIDevice from main-actor isolated context.

This results in changes in AWSCognitoAuthPlugin and InternalAWSPinpoint so that calls to DeviceInfo is executed in an async context.

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.

@phantumcode phantumcode requested a review from a team as a code owner May 20, 2024 17:36
Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 92.79279% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 72.69%. Comparing base (d71438a) to head (9a2ff17).

Files Patch % Lines
...Plugin/AWSCloudWatchLoggingSessionController.swift 63.63% 4 Missing ⚠️
...Storage/AWSS3StorageService+DownloadBehavior.swift 0.00% 3 Missing ⚠️
...AuthPlugin/Support/Utils/SignUpInput+Amplify.swift 97.05% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           enhancement/swift6_update    #3712      +/-   ##
=============================================================
+ Coverage                      68.37%   72.69%   +4.31%     
=============================================================
  Files                           1089      732     -357     
  Lines                          37653    31115    -6538     
=============================================================
- Hits                           25747    22620    -3127     
+ Misses                         11906     8495    -3411     
Flag Coverage Δ
API_plugin_unit_test 68.97% <ø> (+0.21%) ⬆️
AWSPluginsCore 65.81% <ø> (ø)
Amplify ?
Analytics_plugin_unit_test 84.52% <ø> (ø)
Auth_plugin_unit_test 79.40% <98.63%> (+0.04%) ⬆️
DataStore_plugin_unit_test 81.39% <ø> (+0.08%) ⬆️
Geo_plugin_unit_test 72.00% <ø> (ø)
Logging_plugin_unit_test 62.91% <85.18%> (+0.06%) ⬆️
Predictions_plugin_unit_test 37.32% <ø> (ø)
PushNotifications_plugin_unit_test 86.21% <ø> (ø)
Storage_plugin_unit_test 76.75% <72.72%> (+<0.01%) ⬆️
unit_tests 72.69% <92.79%> (+4.31%) ⬆️

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.

@phantumcode phantumcode deleted the enhancement/deviceInfo_strict_concurrency branch May 31, 2024 16:10
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.

1 participant