On 07/08/2011 04:37 AM, Justin Karneges wrote: > I need to be able to page through pubsub items, and XEP-0059 (Result Set > Management) seems like the Right Way to do this. In fact, it is even > mentioned in XEP-0060 (see section 6.5.4), but underspecified. > > Here are my thoughts: > > 1) The client should be able to provide an RSM section in an item retrieval > request: > > <iq type="get" from="[email protected]/1" to="[email protected]" id="2"> > <pubsub xmlns="http://jabber.org/protocol/pubsub"> > <items node="activity"/> > <set xmlns="http://jabber.org/protocol/rsm"> > <max>3</max> > </set> > </pubsub> > </iq> > > 2) The server should be able to provide an RSM section in the iq-result, per > XEP-0060, 6.5.4. It could be argued that the server should be able to reply > with a truncated list and an RSM section even if the client didn't provide an > RSM section, but I wonder if that would affect existing client compatibility > (clients not using RSM might always expect the full item list). I think that this is ok. Because if client will receive one or two, for example, thousands of items then it will not be happy at all.
> > 3) Use of RSM implies that there is a natural ordering of the items. > However, > if RSM is not used, then XEP-0060 does not say anything about item ordering. > Probably this is because the default behavior of a retrieval request is to > return ALL items, in which case the client can sort the items in whatever way > it wants to. Then there is also max_items, which returns the "most recent" > items. So, I think we need some clarifications: > > a) max_items and RSM do not mix. If the client provides both, then the > server MUST prefer RSM. However, if the server does not support RSM, then it > will honor max_items, but have no RSM section in the iq response. This makes > it possible for the client to provide both mechanisms in a request, and be > able to know which one was used by the server. Agreed, clarifications is needed. As well as other clarifications, for example, for a "publisher" attribute. > > b) if RSM is used by the server, then items are returned in a node-specific > order. What means "node-specific"? > > c) if max_items is used, then items are returned in modified descending > order. Agreed. > > d) if neither RSM nor max_items are used, then items are returned in > unspecified order. Not all payloads can be sorted on client side. I think that we need to return some metadata too including creation and modification times as well as item publisher. > > What do others think? And where do we document this? Add a "Item ordering" paragraph to XEP-0060? > > Justin > -- With best regards, Sergey Dobrov, XMPP Developer and JRuDevels.org founder.
