daviddias / api.triage

A simple dashboard to monitor issues on the [node.js](https://github.com/joyent/node), assuring that everyone gets the deserved attention. Currently hosted at {to be hosted}
MIT License
0 stars 2 forks source link

Pagination and continuation token #2

Open nunofmn opened 9 years ago

nunofmn commented 9 years ago

Hey there. When passing the limit parameter to Issue.all function, it returns a continuation token for subsequent queries. This token should be passed to client through an additional header in reply, or should be added as a querystring to the link, in the Link parameter in reply header?

daviddias commented 9 years ago

Don't sent that token to the client, then you would have a 1000 more problems where if the token was tampered or not (also because the token may represent a state that doesn't exist in the consequent request)

Each 'page' are 10 items, if the client asks for the page n2, just make sure that the sorting order remains the same and throw them back the items that start at position 10 (offset=10) :)

nunofmn commented 9 years ago

I was overthinking. The pagination is already done :)

daviddias commented 9 years ago

can you write a test with it using tape please? :)

daviddias commented 9 years ago

@nunofmn ^^ :)