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

Inactive subscriptions #12

Open
elmurci opened this issue Jul 2, 2023 · 3 comments
Open

Inactive subscriptions #12

elmurci opened this issue Jul 2, 2023 · 3 comments

Comments

@elmurci
Copy link
Contributor

elmurci commented Jul 2, 2023

(Not a bug a such, but a thought I would like to share for discussion)

The library persists a subscriptions array that is helpful in case of connection loss so we can keep the "state".

In some cases, we might want to remove certain entries from the array as they become obsolete.

For example, in the following flow:

  1. Path find create request for A
  2. Path find close request for A
  3. Path find create request for B

Even if A is not longer a path we want to explore, the path_find request gets created and closed (before path find request B) on every reconnection meaning we will receive some path messages for it for a few seconds.

@WietseWind
Copy link
Member

I considered this before, indeed, and to keep it simple I left it. But I agree. The best way to deal with this is to "diff" subscriptions and let 2 cancel out 1 if equal. This would be tricky (not impossible) when users e.g. subscribe to certain accounts and then unsubscribe to a part of them.

@elmurci
Copy link
Contributor Author

elmurci commented Jul 11, 2023

Would you like a PR for this?

@WietseWind
Copy link
Member

Would you like a PR for this?

Who would say no to that 🎉 PR for an issue/challenge/shortcoming/... is the dream of an open source maintainer :D

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

No branches or pull requests

2 participants