-
Notifications
You must be signed in to change notification settings - Fork 293
fix: Improve ws connection reliability [FS-803 FS-1037] #13779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
onEvent: this.handleIncomingEvent, | ||
onMissedNotifications: this.triggerMissedSystemEventMessageRendering, | ||
onNotificationStreamProgress: ({done, total}) => { | ||
amplify.publish(WebAppEvents.WARNING.SHOW, Warnings.TYPE.CONNECTIVITY_RECOVERY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a mistake. It triggered the banner everytime we process one message from the notification stream.
Not a big deal, since it's reduced to 1 event, but semantically incorrect
case ConnectionState.PROCESSING_NOTIFICATIONS: { | ||
amplify.publish(WebAppEvents.WARNING.DISMISS, Warnings.TYPE.NO_INTERNET); | ||
amplify.publish(WebAppEvents.WARNING.DISMISS, Warnings.TYPE.CONNECTIVITY_RECONNECT); | ||
amplify.publish(WebAppEvents.WARNING.SHOW, Warnings.TYPE.CONNECTIVITY_RECOVERY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the processing of notification stream gets a clean new lifecycle event.
We can now handle all
the banner displaying in this single method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM :)
Codecov Report
@@ Coverage Diff @@
## dev #13779 +/- ##
==========================================
- Coverage 39.08% 39.08% -0.01%
==========================================
Files 568 568
Lines 21044 21045 +1
Branches 4543 4544 +1
==========================================
Hits 8225 8225
- Misses 11836 11837 +1
Partials 983 983 |
Will use the new lifecycle hook of the
listen
method to display the internet state banner.This should: