You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a dApp using js-waku is offline, relay messages are not received.
Same for filter messages.
Solution
To ensure that no message were missed, a store query should be done once a device resume connectivity.
Definition of Done
A guide that demonstrate how to watch loss of connectivity to then do a store query to retrieve any missed messages.
Can start with filter as it may be easier to detected disconnectivity.
Notes
This guide may be accompanied by a set of helpful API to make it easier to enable/use.
The loss of connectivity refers to relay nodes, that forward messages.
From testing js-libp2p behaviour, it does not seem that the peer:disconnect event on the connectManager is triggered when there is a loss of connection.
Most likely, only a failed attempt to contact a peer allows the node to learn that the peer is not reachable anymore. libp2p-interfaces/pubsub handles this by calling _onPeerDisconnected if a message is failed to send to a peer.
One could either hook this method or watch the number of available relay peers to know whether we are connected.
Then, the start/end time field should be used in the store query to only retrieve messages in the timeframe where we are offline.
Problem
When a dApp using js-waku is offline, relay messages are not received.
Same for filter messages.
Solution
To ensure that no message were missed, a store query should be done once a device resume connectivity.
Definition of Done
A guide that demonstrate how to watch loss of connectivity to then do a store query to retrieve any missed messages.
Can start with filter as it may be easier to detected disconnectivity.
Notes
This guide may be accompanied by a set of helpful API to make it easier to enable/use.
The loss of connectivity refers to relay nodes, that forward messages.
From testing js-libp2p behaviour, it does not seem that the
peer:disconnect
event on theconnectManager
is triggered when there is a loss of connection.Most likely, only a failed attempt to contact a peer allows the node to learn that the peer is not reachable anymore.
libp2p-interfaces/pubsub
handles this by calling_onPeerDisconnected
if a message is failed to send to a peer.One could either hook this method or watch the number of available relay peers to know whether we are connected.
Then, the start/end time field should be used in the store query to only retrieve messages in the timeframe where we are offline.
Inspire yourself to what status is doing: https://rfc.vac.dev/spec/27/#peer-connectivity
Card to write RFC for relay ping: https://github.com/status-im/js-waku/projects/1#card-65707839
The text was updated successfully, but these errors were encountered: