Skip to content

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

Merged
merged 2 commits into from
Oct 3, 2022
Merged

fix: Improve ws connection reliability [FS-803 FS-1037] #13779

merged 2 commits into from
Oct 3, 2022

Conversation

atomrc
Copy link
Contributor

@atomrc atomrc commented Oct 3, 2022

BugFS-803 [iOS] Crash after unlock EAR on col3 prod bund build when device has no Face ID capability

Will use the new lifecycle hook of the listen method to display the internet state banner.

This should:

  • improve the display of the no_internet banner (and be consistent with the actual websocket state)
  • improve handling messages and connecting to the websocket (a gap has been fixed upon connection to the websocket)

@atomrc atomrc requested review from a team and otto-the-bot as code owners October 3, 2022 09:47
@atomrc atomrc changed the title fix: Improve ws connection reliability fix: Improve ws connection reliability [FS-803 FS-1037] Oct 3, 2022
onEvent: this.handleIncomingEvent,
onMissedNotifications: this.triggerMissedSystemEventMessageRendering,
onNotificationStreamProgress: ({done, total}) => {
amplify.publish(WebAppEvents.WARNING.SHOW, Warnings.TYPE.CONNECTIVITY_RECOVERY);
Copy link
Contributor Author

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

Comment on lines +140 to +143
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);
Copy link
Contributor Author

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

Copy link
Contributor

@przemvs przemvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM :)

@atomrc atomrc enabled auto-merge (squash) October 3, 2022 10:08
@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Merging #13779 (9e7929b) into dev (51dc1f1) will decrease coverage by 0.00%.
The diff coverage is 14.28%.

@@            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              

@atomrc atomrc merged commit 500b47d into dev Oct 3, 2022
@atomrc atomrc deleted the fix/ws branch October 3, 2022 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants