awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
921 stars 266 forks source link

Multiple Queries in quick succession get stuck on loading #341

Open Gerharddc opened 5 years ago

Gerharddc commented 5 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? On most of my React-Native screens that contain more than one Query, only the first one ever gets loaded and rest are stuck on loading forever. I can confirm from AppSync logs that no network requests are ever made for those queries. They also never return an error and are simply stuck. Using the AppSync console, I can confirm that the resolvers do work properly if they receive a request.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. I appear to be getting this on all screens (I'm using react-navigation) with multiple queries (Apollo 2 type Query components). I have tried setting fetch-policy to network only and disabling offline on the AppSyncClient but it made no difference.

What is the expected behavior? All the queries should resolve or at least throw errors.

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? I am seeing the exact same behaviour on iOS and Android. My relevant package versions are as follows:

"@aws-amplify/analytics": "^1.2.10", "@aws-amplify/auth": "^1.2.15", "@aws-amplify/pushnotification": "^1.0.22", "amazon-cognito-identity-js": "^3.0.7", "apollo-client": "^2.4.12", "aws-appsync": "^1.7.1", "aws-appsync-react": "^1.2.6", "aws-sdk": "^2.391.0", "graphql": "^14.1.1", "graphql-tag": "^2.10.1", "react": "16.6.3", "react-native": "^0.57.8", "react-navigation": "3.0.9",

Gerharddc commented 5 years ago

Ok so this only happens when trying to use redux-saga as well.

elorzafe commented 5 years ago

@Gerharddc how you were using redux-saga I am curious about this has conflict with redux-offline (which appsync-sdk uses)