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

13/WAKU2-STORE: Message order based on Direction #76

Open
jimstir opened this issue Jun 14, 2024 · 0 comments
Open

13/WAKU2-STORE: Message order based on Direction #76

jimstir opened this issue Jun 14, 2024 · 0 comments

Comments

@jimstir
Copy link
Collaborator

jimstir commented Jun 14, 2024

Reference Issue: vacp2p/rfc#463
Author: D4nte

Problem

The Direction field in HistoryQuery for Waku Store allows the query to specify the direction in which results should be returned:

direction: indicates the direction of paging which can be either FORWARD or BACKWARD.

This does not affect the order of messages within a page. Messages are always order oldest first.

It seems a bit counter-intuitive to me. Indeed, if a caller uses the direction BACKWARD one could argue that they want to process the latest message first.
However, with the current design, they would need to browse the returned array from the end to process the latest message first.

Possible Solutions

A solution would be for the order of messages to be affected by the direction value.
Another solution would be to introduce a new field to request order of messages or a new field that affect both page and message order to then deprecate the current direction field.

Notes

Depending on the solution, we may need to upgrade the protocol version to ensure we do not modify the existing behaviour.

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

No branches or pull requests

1 participant