aws-mobile-appsync-sdk-ios icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-ios copied to clipboard

Cannot watch queries when offline

Open oakesja opened this issue 5 years ago • 2 comments

Describe the bug We cannot watch queries when offline using the default cachePolicy of returnCacheDataElseFetch. I believe that this is because the fetch returns a network error so it does not have any dependent keys. This overwrites the dependent keys from the cached data.

To Reproduce Steps to reproduce the behavior:

  1. Run a query when the device is connected online so that its result is cached
  2. Watch the same query while offline
  3. Run a mutation offline with an optimistic update that will update the cache for the query being watched
  4. The watch query result handler will not be called on the cache update

Expected behavior We would like to be able to watch queries when there is no network connection to be able to handle cache updates from a mutation's optimistic update.

Environment:

  • AppSync SDK Version: 2.10.2

oakesja avatar Mar 22 '19 13:03 oakesja

The answer is probably that is not supported, but I have tagged @rohandubal for a better answer of the current state of the SDK.

minbi avatar Mar 25 '19 20:03 minbi

We're tracking this as a feature request.

frankmuellr avatar Apr 19 '19 20:04 frankmuellr

Thank you for opening this issue. AWS AppSync SDK for iOS entered maintenance mode in September 2023 and will receive no further updates as of September 2024.

Please use Amplify Swift going forward. For information on upgrading to Amplify Swift, refer to the Upgrade from AppSync SDK documentation.

atierian avatar Dec 07 '23 20:12 atierian