amplify-flutter icon indicating copy to clipboard operation
amplify-flutter copied to clipboard

If the app is started without connectivity, once connectivity is restored, networkStatus event is not dispatched

Open giulitu95 opened this issue 1 year ago • 3 comments

Description

If the app is started without connectivity, as soon as connectivity is restored, the networkStatus event is not dispatched by the datastore hub channel and the related callback is not triggered. I experience this problem only on iOS devices while on android devices the event is correctly dispatched.

Categories

  • [ ] Analytics
  • [ ] API (REST)
  • [ ] API (GraphQL)
  • [ ] Auth
  • [ ] Authenticator
  • [X] DataStore
  • [ ] Notifications (Push)
  • [ ] Storage

Steps to Reproduce

  1. Start the application without connectivity after the amplify configuration
  2. Enable iternet connection on a iOS device
  3. The hub event is not dispatched and the callback is not triggered

Screenshots

No response

Platforms

  • [X] iOS
  • [ ] Android
  • [ ] Web
  • [ ] macOS
  • [ ] Windows
  • [ ] Linux

Flutter Version

3.24.3

Amplify Flutter Version

2.4.2

Deployment Method

Amplify CLI (Gen 1)

Schema

No response

giulitu95 avatar Oct 28 '24 14:10 giulitu95

Hello @giulitu95, thanks for sharing this issue with us. We will reproduce the issue and investigate the cause. We will provide an update when we can.

ekjotmultani avatar Oct 28 '24 16:10 ekjotmultani

After some tests I have discovered that network status events are correctly dispatched only after datastore tries to synchronize a model without internet connection. At this point a SocketException is raised (https://github.com/aws-amplify/amplify-flutter/issues/5360) but the related network status event is not yet dispatched. All events start to be correctly generated only when user restore the internet connection.

giulitu95 avatar Oct 29 '24 08:10 giulitu95

Thank you for further testing and providing this info @giulitu95. We are attempting to reproduce this issue and will check the flow described here, will notify you once we have an update.

ekjotmultani avatar Oct 29 '24 22:10 ekjotmultani