Getting "Software caused connection abort" in AppSync

795 Views Asked by At

I have a simple GraphQl query that works fine all the time when I call it Except in on case when I minimize my app and receive the push and when I open the app by tapping on the push I fire a AppSync query sometimes it works and sometime I receive this error in the response : -

Optional
▿ some : AWSAppSyncClientError
▿ requestFailed : 3 elements
- .0 : nil
- .1 : nil
▿ .2 : Optional
- some : Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={_kCFStreamErrorCodeKey=53, _kCFStreamErrorDomainKey=1}

I would like to mention that I'm Developing this application in iOS having AppSync version 2.10.1.

Didn't seem to find this problem regarding AppSync so if anybody have an idea feel free to share.

Thanks.

1

There are 1 best solutions below

0
On

According to the other questions and answers posted in the comment, it looks like a temporary network condition in iOS that might happen with background apps.

As "everything fails, all the time" I would suggest to trap this error and retry.

Do not retry infinitely, nor immediately, rather implement an exponential backoff strategy. See how to it and pseudo code sample here : https://docs.aws.amazon.com/general/latest/gr/api-retries.html

This strategy for error handling is considered a best practice when dealing with remote services.