-
Notifications
You must be signed in to change notification settings - Fork 267
Fix pagination by time to filter entries from_time into the past (desc) #2144
base: develop
Are you sure you want to change the base?
Changes from 2 commits
b9a7d03
b5abaa4
ec852e8
afc5b7e
d284fec
98f1885
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,7 +188,7 @@ impl DhtStore { | |
.skip_while(move |eavi| { | ||
let from_time: DateTime<FixedOffset> = | ||
paginated_time.from_time.into(); | ||
from_time.timestamp_nanos() >= eavi.index() | ||
from_time.timestamp_nanos() <= eavi.index() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the line that I see a couple problems with:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I can make the change, eavi has a constructor that allows you to create it with the index so any node that recieves a link and stores it on their dht will do that according to the timestamp in the link topchainheader. Which means from the link perspective, there is no explicit timestamp generation on the eavi side. The reasoning was because if a node has the base it could use the eavi system to query based on timestamps. Pro of this method is that you wouldn't have to do an extra get entry for the lazy pagination. E.G. eavi.index is essentially link timestamp but if a distinction has to be made that I could change that around no problem |
||
}) | ||
.take(time_pagination.limit), | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I certainly agree with the intention of the PR and I though we were supposed to be defaulting to descending dates in the sort order which should get you before... but I guess if that was happening, you wouldn't be trying to fix it. :)