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
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.
Provide a user-configurable setting for N.
Chore: drop waku1 code from Messenger.watchConnectionChange().
Problem
We need to fetch messages periodically from store nodes.
Currently this is done by https://github.com/status-im/status-go/blob/dfdc1652a2e28c41059b8bc187c78b92c325d253/protocol/messenger.go#L928 which is periodically invoked from
Messenger.watchConnectionChange()
: https://github.com/status-im/status-go/blob/dfdc1652a2e28c41059b8bc187c78b92c325d253/protocol/messenger.go#L1447But 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
ConnStatusSubscription
s.UPDATE: clear now, the
polling
mechanism is only there for deprecated wakuv1. Additionally, wakuv1 also supportsmailserver cycle events
, that are processed when peers are updated.So, we need a proper polling mechanism for store node messages.
Proposed solution
N
.Messenger.watchConnectionChange()
.cc @churik @cammellos