Closed goffi-contrib closed 3 years ago
My commits for #3618 only took care about the Index attribute. I noticed, like you, that the items are returned in reverse order when using <before/>
. I thought that was desired because the XEP section is named "Paging Backwards Through a Result Set"...
Now that you mentioned, and I read again the XEP, it is quite clear: the items must be returned always in order:
The last item in the page returned by the responding entity MUST be the item that immediately preceeds the item that the requesting entity indicated it has already received:
https://xmpp.org/extensions/xep-0059.html#backwards
So it's a bug in ejabberd that still requires fixing.
Environment
ejabberd version: 20.12
OS: unix/linux 4.19.0
Installed from: other
Bug description
Hello,
this bug is related to https://github.com/processone/ejabberd/issues/3618 I've seen it after publishing, so the fix to #3618 may have fixed this one too, in which case this one can be closed and sorry for the noise :).
This has been seen on a running instance of Movim. When I request a page of items of a blog with RSM items are returned in non chronological order, while they should be in chronological order.
Note that this issue happens when
<before/>
is used to get last page, but if we request the first page with only<max>3</max>
, then the items are in expected order.Here is the relevant stream capture:
In addition to the
index
issue described and fixed with #3618, the item are returned in anti-chronological order, and we have:where it should be the opposite (
first
should be2021-04-04T15:18:12.443634Z
andlast
should be2021-05-27T22:41:35.266278Z
), and items should reversed.Thanks!