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

fix(Logging): adding internal configure auth hub event listener to fix logging race condition #3899

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

harsh62
Copy link
Member

@harsh62 harsh62 commented Oct 18, 2024

Issue #

#3897

Description

Integration Tests | API - All

There is a race condition where the Auth category is not configured when logging needs current users identifier. The fix removes the delayed call to fetch the current users identifier and relies on the Hub Event to update users identifier.

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.

@harsh62 harsh62 marked this pull request as ready for review October 18, 2024 03:04
@harsh62 harsh62 requested a review from a team as a code owner October 18, 2024 03:04
@harsh62 harsh62 changed the title fix(Logging): configure logging after auth to fix a race condition fix(Logging): adding internal configure auth hub event listener to fix logging race condition Oct 18, 2024
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 69.68%. Comparing base (619867b) to head (d5810f2).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...AuthPlugin/Operations/AuthConfigureOperation.swift 25.00% 3 Missing ⚠️
...ingPlugin/AWSCloudWatchLoggingCategoryClient.swift 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3899      +/-   ##
==========================================
+ Coverage   68.01%   69.68%   +1.67%     
==========================================
  Files        1087     1087              
  Lines       38123    49592   +11469     
==========================================
+ Hits        25930    34560    +8630     
- Misses      12193    15032    +2839     
Flag Coverage Δ
API_plugin_unit_test 70.97% <ø> (+1.61%) ⬆️
AWSPluginsCore 70.02% <ø> (+1.52%) ⬆️
Amplify 48.26% <ø> (+1.33%) ⬆️
Analytics_plugin_unit_test 85.77% <ø> (+1.25%) ⬆️
Auth_plugin_unit_test 80.73% <25.00%> (+1.44%) ⬆️
DataStore_plugin_unit_test 84.31% <ø> (+2.88%) ⬆️
Geo_plugin_unit_test 75.22% <ø> (+3.15%) ⬆️
Logging_plugin_unit_test 63.42% <0.00%> (+0.42%) ⬆️
Predictions_plugin_unit_test 36.35% <ø> (+0.48%) ⬆️
PushNotifications_plugin_unit_test 88.12% <ø> (+1.90%) ⬆️
Storage_plugin_unit_test 77.13% <ø> (+1.66%) ⬆️
unit_tests 69.68% <16.66%> (+1.67%) ⬆️

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.

@harsh62 harsh62 merged commit 65da44e into main Oct 18, 2024
79 checks passed
@harsh62 harsh62 deleted the fix-3897 branch October 18, 2024 14:27
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