waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
162 stars 41 forks source link

feat: improve offline recoverability of Filter #2024

Open weboko opened 1 month ago

weboko commented 1 month ago
This is a **feature request** ## Problem Currently once `js-waku` looses and then recovers connection (either Internet or to all peers) - existing Filter subscriptions misbehave. ## Proposed Solutions If internet connection was lost: 1. redial peers to which subscription was created; 2. ping and if fails - try to create a new one; If peers were disconnected: 1. simply trying to redial should help; These are things that helped me to recover subscriptions during my local experimentation. ## Notes Part of https://github.com/waku-org/pm/issues/143
weboko commented 1 month ago

@danisharora099 would be happy to hear your opinion on the approach

danisharora099 commented 1 month ago

@danisharora099 would be happy to hear your opinion on the approach

Thanks for documenting @weboko.

I'd see these two cases under the same umbrella, as application is not aware if it's a peer disconnection or an internet connection loss -- both of them need to be inferred by recurring Filter pings failing:

-- PS: perhaps the online/offline state in ConnectionManager can be extended to be per protocol instead.

danisharora099 commented 1 month ago

@weboko I see this is in progress. I'm curious of how this will be actioned. Can you help share your POV to this? To me it looks like a followup after #2002 is implemented, where we have access to the state of peers used by each protocol, and in this case Filter.

redial peers to which subscription was created; ping and if fails - try to create a new one;

danisharora099 commented 4 days ago

Note: the Filter pings and renewals is a part of https://github.com/waku-org/js-waku/issues/2002. The scope of this issue is solving for js-waku's disconnection