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).

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.

  b) if RSM is used by the server, then items are returned in a node-specific 
order.

  c) if max_items is used, then items are returned in modified descending 
order.

  d) if neither RSM nor max_items are used, then items are returned in 
unspecified order.

What do others think?  And where do we document this?

Justin

Reply via email to