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

Fetch messages from store nodes on a scheduled basis #5283

Closed
vitvly opened this issue Jun 4, 2024 · 1 comment
Closed

Fetch messages from store nodes on a scheduled basis #5283

vitvly opened this issue Jun 4, 2024 · 1 comment
Assignees

Comments

@vitvly
Copy link
Contributor

vitvly commented Jun 4, 2024

Problem

We need to fetch messages periodically from store nodes.

Currently this is done by

m.asyncRequestAllHistoricMessages()

which is periodically invoked from Messenger.watchConnectionChange():
processNewState(m.Online())

But this won't fetch anything in case there was no connection state change. Moreover, this is not a pure polling mechanism, as same role is fulfilled by the code below, that utilizes waku2's ConnStatusSubscriptions.

UPDATE: clear now, the polling mechanism is only there for deprecated wakuv1. Additionally, wakuv1 also supports mailserver cycle events, that are processed when peers are updated.

So, we need a proper polling mechanism for store node messages.

Proposed solution

  1. Write a code that will do the following every N minutes:
  • check if we're current in the process of fetching. If so, do nothing.
  • otherwise, and if last fetch time was earlier than N minutes, start fetching.
  1. Provide a user-configurable setting for N.
  2. Chore: drop waku1 code from Messenger.watchConnectionChange().

cc @churik @cammellos

@vitvly vitvly self-assigned this Jun 4, 2024
@vitvly
Copy link
Contributor Author

vitvly commented Jun 25, 2024

Respective PR (#5292) closed, some refactorings extracted into #5420.

@vitvly vitvly closed this as completed Jun 25, 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 a pull request may close this issue.

1 participant