Skip to content
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

feat(push): add callback on subscription lost event #2737

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

cromoteca
Copy link
Contributor

@cromoteca cromoteca commented Sep 17, 2024

This PR allows to define a behavior for when the reopened event happens on the client.

The new onSubscriptionLost callback can be used to perform an action when the websocket is reopened, but there's no longer a Flux connected to the subscription. Based on the return value of that callback, automatic resubscription can be performed.

Fixes #2716

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.48%. Comparing base (ec4ba7f) to head (c18d859).

Files with missing lines Patch % Lines
packages/ts/frontend/src/FluxConnection.ts 83.33% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2737      +/-   ##
==========================================
- Coverage   94.53%   94.48%   -0.05%     
==========================================
  Files          81       81              
  Lines        2635     2648      +13     
  Branches      664      666       +2     
==========================================
+ Hits         2491     2502      +11     
- Misses        140      142       +2     
  Partials        4        4              
Flag Coverage Δ
unittests 94.48% <83.33%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cromoteca cromoteca changed the title fix(push): resubscribe after reconnecting fix!(push): resubscribe after reconnecting Sep 17, 2024
@cromoteca cromoteca changed the title fix!(push): resubscribe after reconnecting fix(push): resubscribe after reconnecting Sep 18, 2024
@cromoteca cromoteca marked this pull request as ready for review September 19, 2024 07:59
@cromoteca cromoteca changed the title fix(push): resubscribe after reconnecting feat(push): add callback on subscription lost event Sep 19, 2024
Copy link

sonarcloud bot commented Sep 20, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[push] client tries to reconnect to a Flux that no longer exists
1 participant