Closed abel30567 closed 2 years ago
Hi @abel30567 👋 thanks for raising this issue. Currently trying to reproduce this. So, the behavior you're seeing is that the websocket is taking more than 15 seconds to connect? That seems unusually long.
I did notice that one of your dependencies, @react-native-community/netinfo
, is out of date. Could you try upgrading it to the latest version of 7.1.2 and see if that makes a difference in connection speed?
@chrisbonifacio I tried updating it and got the same issue. I figured out my issue though. It turns out the device I was developing with had it's time delayed for more than 30 seconds. I synced my device's NTP Server and now it seems to be working with that update.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
PubSub
Amplify Categories
api
Environment information
Describe the bug
I am trying to create a subscription to a certain mutation using React Native and
amplify-js
. But I keep gettingConnection failed: Connection timeout: ack from AWSRealTime was not received on 15000 ms
errors on initializing the subscription.Expected behavior
The subscription is expected to remain listening for any changes to a certain mutation. It should reproduce something like the logs below
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
Temporary Workaround
I increased the
CONNECTION_INIT_TIMEOUT
and theSTART_ACK_TIMEOUT
to get expected behavior in theAWSAppSyncRealTimeProvider
and that got it to work. From 15000 => 150000 https://github.com/aws-amplify/amplify-js/blob/main/packages/pubsub/src/Providers/AWSAppSyncRealTimeProvider.ts#L130-L139