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(core): add Foundation HTTP client for watchOS / tvOS #3230

Merged
merged 16 commits into from
Sep 21, 2023

Conversation

atierian
Copy link
Member

@atierian atierian commented Sep 20, 2023

Issue #

Description

Network requests that Amplify makes to services through the AWS SDK for Swift end up going through AWS Common Runtime (CRT) rather than Foundation.

This is fine for iOS, macOS, watchOS, and tvOS when running on Simulator.
It's also fine for physical devices running iOS, macOS, and tvOS.
However, the CRT networking layer doesn't play nice with watchOS running on physical Apple Watches.

This change utilizes the HttpClientEngine that can be injected into service clients in the AWS SDK for Swift.
If running on watchOS or tvOS, we'll use Foundation for networking instead of CRT.

Why tvOS?

As of today, CRT works when running on physical Apple TVs. However, tvOS isn't officially supported by AWS SDK for Swift and we don't have a good way to test against hardware related regressions. For that reason, we're using Foundation for tvOS as well.

Plugin Overview

SDK clients used by plugins that are now using FoundationClientEngine for watchOS and tvOS

AWSCognitoAuthPlugin

  • CognitoIdentityProviderClient
  • CognitoIdentityClient

AWSLocationGeoPlugin

  • LocationClient

AWSPinpointAnalyticsPlugin / AWSPinpointPushNotificationsPlugin

  • PinpointClient in InternalAWSPinpoint

AWSCloudWatchLoggingPlugin

  • CloudWatchLogsClient

AWSPredictionsPlugin

  • TranslateClient
  • PollyClient
  • ComprehendClient
  • RekognitionClient
  • TextractClient

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.

@atierian atierian force-pushed the foundation-http-client branch from 13c06ce to a9e7ad8 Compare September 20, 2023 18:54
@atierian atierian temporarily deployed to Fortify September 20, 2023 18:54 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to Fortify September 20, 2023 19:04 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:16 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 20, 2023 19:17 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 16:09 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian temporarily deployed to IntegrationTest September 21, 2023 17:24 — with GitHub Actions Inactive
@atierian atierian merged commit 6fa88d4 into main Sep 21, 2023
84 checks passed
@atierian atierian deleted the foundation-http-client branch September 21, 2023 18:00
phantumcode added a commit that referenced this pull request Sep 21, 2023
* main:
  fix(core): add Foundation HTTP client for watchOS / tvOS (#3230)
  chore: finalize release 2.18.0 [skip ci]
  chore: release 2.18.0 [skip ci]
  feat: Setting mininum watchOS version to 9 (#3229)
  change swift-tools-version to 5.7 (#3193)
  chore: finalize release 2.17.2 [skip ci]
  chore: release 2.17.2 [skip ci]
  fix(datastore): use unwrapped storageEngine to perform datastore operations (#3204)
  fix(datastore): using URLProtocol monitor auth request headers (#3221)
  ci: add dependency review workflow (#3132)
  fix(api): change request interceptors applying logic (#3190)
phantumcode added a commit that referenced this pull request Sep 26, 2023
* main:
  chore(ci): update dependency review config file path (#3233)
  test(logging): add logging plugin integration test (#3218)
  chore: remove unnecessary CloudWatch dependency from logger plugin (#3235)
  chore: Update CHANGELOG.md for 2.18.0 (#3236)
  chore: finalize release 2.18.1 [skip ci]
  chore: release 2.18.1 [skip ci]
  fix(core): add Foundation HTTP client for watchOS / tvOS (#3230)
  chore: finalize release 2.18.0 [skip ci]
  chore: release 2.18.0 [skip ci]
  fix(datastore): call errorHandler in Sync operation when failure
  feat: Setting mininum watchOS version to 9 (#3229)
  change swift-tools-version to 5.7 (#3193)
  chore: finalize release 2.17.2 [skip ci]
  chore: release 2.17.2 [skip ci]
  fix(datastore): use unwrapped storageEngine to perform datastore operations (#3204)
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.

4 participants