buddycloud/buddycloud-server — pull request #120 by lloydwatkin (2013-06-18 12:01:30+00:00)
Title: Order !items requests by UPDATED *ASC* not DESC

See recent post in team channel which reads

```
I have an issue with the java server and remote channels with lots of subscribers.

Essentially the first time a client connects to a remote channel the server essentially intercepts result stanzas adding data to the data base and passing on to the client. The next time a request is made the data comes directly from the database unless RSM returns no results (in which case we go remote again). This makes for very efficient caching as we only have what we need. (The same applies for affiliations and items).

Except.... as affiliations and subscriptions don't contain updated timestamp (like items). This is fine for the first page of an RSM request as I can just reverse the order of the entries and all is good. When I hit a popular channel however there's no (simple) way I can put the entries into the database with the same order (the actual timestamps don't matter).

I believe the simpler things are the better they are.

There's one easier way around this is to order subscriptions and affiliations by `updated` *ascending* rather than descending. I'm going to drop in a pull request for this for the node.js server and get the same changes in place for the java server for when both projects are ready.
```