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

bug: filter subscription stops without occasional pings #1923

Closed
vpavlin opened this issue Mar 18, 2024 · 4 comments · Fixed by #1970
Closed

bug: filter subscription stops without occasional pings #1923

vpavlin opened this issue Mar 18, 2024 · 4 comments · Fixed by #1970
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@vpavlin
Copy link
Member

vpavlin commented Mar 18, 2024

This is a support request

Problem

I created waku-dispatcher some time ago to overcome some of the drawbacks of js-waku - mainly the unreliability in peer connections and message delivery.

I tried to update to latest version (0.0.23), which solved my issues with lightpush (and not being able to publish), but it is somehow breaking filter and my example app fails to receive any messages.

Let me describe the flow:

  1. Dispatcher gets initialized
  2. dispatcher.start() then subscribes to the configured contentTopic
  3. Dispatcher sets up an interval where it attempts to check the subscription (unsing ping) and it tries to unsubscribe and subscribe again if the ping fails

When I publish the message using the example (https://github.com/vpavlin/waku-dispatcher/tree/chore/update-waku/example) it initially gets delivered fine, but over time the delivery (using filter) starts failing and then even the re-subscription attempts start to fail.

Various errors seen:

Screenshot from 2024-03-18 12-42-43
Screenshot from 2024-03-18 12-42-32
Screenshot from 2024-03-18 12-12-04
image

One way to overcome the errors is to clear the waku:peers localStorage field - everything works fine for ~5-10 minutes after I clean it, but then the errors come back again.

It is highly possible, that my subscription or peers handling is wrong in waku-dispatcher, but I cannot find any obvious issue

How to reproduce

git clone https://github.com/vpavlin/waku-dispatcher.git
cd waku-dispatcher
git checkout chore/update-waku
npm install
npm run build
cd example
npm install ../
npm start

Notes

@vpavlin
Copy link
Member Author

vpavlin commented Mar 18, 2024

I am running https://github.com/waku-org/lab.waku.org/tree/master/examples/light-js with updated waku/sdk for over an hour, so the problem above probably stems from my attempts to overcome the unreliability:D

@vpavlin
Copy link
Member Author

vpavlin commented Mar 18, 2024

Actually, that failed after some time also. The strange part is that everythign works perfectly for a while when I clean up the waku:peers localstorage cache.

@weboko
Copy link
Collaborator

weboko commented Apr 22, 2024

The task is a bit outdated. Current behavior in the latest version(waku-org/lab.waku.org#60) is as follows (according to @vpavlin):

  • when tab is left unattended for 5 minutes - Filter stops to receive messages.

It is consistently repro for me and easily fixable by using periodic pings.

Problem is addressed in #1970

Next steps:

  • check how it works if tab is suspended by the browser;
  • check if connection is kept after 10+ minutes;
  • in case all peers are disconnected (currently Filter keeps 3) - populate them again automatically;

@vpavlin
Copy link
Member Author

vpavlin commented Apr 24, 2024

Should I test the PR somehow? HAppy to help verifying it fixes the issues

@weboko weboko added the enhancement New feature or request label Apr 24, 2024
@weboko weboko changed the title Filter subscription problems bug: filter subscription stops without occasional pings Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants