Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

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

Closed
D4nte opened this issue Oct 10, 2021 · 3 comments
Closed

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

D4nte opened this issue Oct 10, 2021 · 3 comments

Comments

@D4nte
Copy link
Contributor

D4nte commented Oct 10, 2021

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.

@oskarth
Copy link
Contributor

oskarth commented Oct 18, 2021

fyi @staheri14

@staheri14
Copy link
Contributor

@oskarth yeah! I knew about the issue (discussed it with @D4nte over discord). Will prioritize it.

@jimstir
Copy link
Contributor

jimstir commented Jun 14, 2024

Issue moved here

@jimstir jimstir closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants