If the app is started without connectivity, once connectivity is restored, networkStatus event is not dispatched
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
- Start the application without connectivity after the amplify configuration
- Enable iternet connection on a iOS device
- 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
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.
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.
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.