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

AWS Amplify Network Issue on Watch OS development #3215

Closed
pravarsha21 opened this issue Sep 11, 2023 · 11 comments
Closed

AWS Amplify Network Issue on Watch OS development #3215

pravarsha21 opened this issue Sep 11, 2023 · 11 comments
Assignees
Labels
bug Something isn't working core Amplify Core components

Comments

@pravarsha21
Copy link

Describe the bug

I have created a voice recorder application for watch only app in xcode. The logic is when the user stops the recording, the recorded audio file is transferred red to AWS S3 bucket.

The code is working fine when I run the app on Xcode Watch OS simulator.

But when I install it on the physical watch, every time it is giving network error. I have added all the required permissions and also pinged a basic website and it returned as OK.

Steps To Reproduce

I think it is difficult to reproduce since you need the code of my app

Expected behavior

The expected behaviour is it should transfer the files to S3

Amplify Framework Version

2.17.1

Amplify Categories

Storage

Dependency manager

Swift PM

Swift version

5.8

CLI version

12.4.0

Xcode version

14+

Relevant log output

<details>
<summary>Log Messages</summary>


🔍 File exists, proceeding with upload.
🔍 Network available: true
🔍 Uploading Recording_09-10-2023_22-51-23_966
🔍 Data size: 43304 bytes
2023-09-10T22:51:34-0500 info CognitoIdentityClient : [Logging] Request: POST https:443 
 Path: / 
 Content-Type: application/x-amz-json-1.1, 
User-Agent: aws-sdk-swift/1.0 api/cognito-identity/1.0 os/watchOS/9.6.1 lang/swift/5.8 lib/amplify-swift/2.17.1, 
Content-Length: 79, 
x-amz-user-agent: aws-sdk-swift/1.0, 
Host: cognito-identity.us-east-2.amazonaws.com, 
X-Amz-Target: AWSCognitoIdentityService.GetId 
 Optional([])
2023-09-10T22:51:34-0500 info SerialExecutor : [Logging] Creating connection pool for Optional("https://cognito-identity.us-east-2.amazonaws.com/?")with max connections: 50
🛑 Full error object: StorageError: The operation couldn’t be completed. (AwsCommonRuntimeKit.CommonRunTimeError error 0.)
Recovery suggestion: Check your network connection, retry when the network is available.
HTTP Response stauts code: nil
🛑 Storage error: The operation couldn’t be completed. (AwsCommonRuntimeKit.CommonRunTimeError error 0.). Check your network connection, retry when the network is available.
```

Is this a regression?

Yes

Regression additional context

No response

Platforms

watchOS

OS Version

16

Device

Apple Watch 8

Specific to simulators

No response

Additional context

No response

@phantumcode
Copy link
Contributor

@pravarsha21 Thanks for opening the issue. We will investigate and get back to you soon.

@phantumcode phantumcode added the storage Issues related to the Storage category label Sep 12, 2023
@sebaland
Copy link
Contributor

@pravarsha21 could you please share the logs with verbose logging enabled?
They might include additional useful information.

Amplify.Logging.logLevel = .verbose

Also, are you using the uploadFile(key:local:) API and doing something like this?

let file = // your recording file
let uploadTask = Amplify.Storage.uploadFile(
    key: "yourKey",
    local: file
)

_ = try await uploadTask.value

@atierian atierian added pending-community-response Issue is pending response from the issue requestor bug Something isn't working labels Sep 15, 2023
@atierian atierian self-assigned this Sep 20, 2023
@atierian atierian added the work in progress Issues was triaged and investigation done label Sep 20, 2023
@atierian
Copy link
Member

Hey @pravarsha21, quick update from our side - we've identified the issue and are working on a fix.
We'll let you know once it's released.

@atierian atierian added core Amplify Core components pending-release Code has been merged but pending release Code has been merged but pending release and removed pending-community-response Issue is pending response from the issue requestor storage Issues related to the Storage category work in progress Issues was triaged and investigation done labels Sep 24, 2023
@atierian
Copy link
Member

This fix was released with 2.18.1

Thanks again for reporting it @pravarsha21

@github-actions github-actions bot removed the pending-release Code has been merged but pending release Code has been merged but pending release label Sep 25, 2023
@SrinivasKalagotla
Copy link

Thankyou for solving the issue, it was very helpful for me and my team mate Pravarsha.

@pravarsha21
Copy link
Author

thankyou @atierian for solving the issue .

@gurupatel107
Copy link

gurupatel107 commented Nov 30, 2023

@atierian Thank you for fixing this bug. We had faced error when doing authentication, precisely on Amplify.Auth.signIn(). With fix you've done is working fine for us.
However we've tricky situation here.
Our watch app supports minimum version of 7.6. And current fix is on 2.18.1 which required to have min watchOs version 9+. Upgrading to minimum watchOs version to 9 is not quite feasible for us.

So is there any tag or specific release where this issue is fixed but watchOs version remains 7 only. If there is no specific release or commit. Would it be possible to plan out one release ?

Amplify Framework Version
2.17.2 (Supports min watchOs version 7+)

Dependency manager
Swift PM

Xcode version
15+

@5d
Copy link
Contributor

5d commented Nov 30, 2023

Hi @gurupatel107,

To better assist you, could you please provide more details on the difficulties or constraints you are facing with upgrading the minimum watchOS support to version 9? Understanding the specific challenges will help us explore potential solutions or consider adjustments in our future planning.

@gurupatel107
Copy link

Sure @5d.

Our existing application for watchOS is already on App Store and support minimum watchOs version 7.6.
Recent changes we had done were adding AWS authentication for iOS app and had to add same in watch app too using this library.

As some users may still be utilising watchOS versions 7 or 8. Given our commitment to maintaining compatibility across different versions, we are faced with the challenge of ensuring that our Watch app continues to support a broad range of watchOS versions. Consequently, setting the minimum deployment version to 9+ is not currently feasible in alignment with our internal guidelines and decisions.

So we would like to have help if any possible update were version 2.17.2 (last version which support watchOs 7+) with the current bug fix of including this PR#3230.

Looking forward to have your collaboration in this situation.

@gurupatel107
Copy link

@5d and @atierian
Looking forward for your response and suggestions for the same here.

@atierian
Copy link
Member

atierian commented Dec 28, 2023

Hey @gurupatel107. Apologies for the delayed response here; we missed this because the issue was closed.

Amplify Swift supports watchOS 9 as a minimum target. However, there is nothing (currently) that requires watchOS 9 in Amplify Swift. To work around this, you can add Amplify Swift as a local package dependency and change this line in the Package.swift file to .watchOS(.v7).

Please note that we can't make any guarantees that APIs requiring watchOS 9 won't be used in the future -- in other words, this workaround may not work for future versions.

I understand that every app has its own requirements around minimum supported versions. In case you haven't already, I'd encourage you to consider that the most recent Apple Watch unable to run watchOS 9 is the Series 3 from 2017 [source].

If you need any further assistance on this, please open a new issue. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Amplify Core components
Projects
None yet
Development

No branches or pull requests

7 participants