HomePhabricator

Use cursor-based paging in Differential

Description

Use cursor-based paging in Differential

Summary:
Ref T603. Ref T2625. Use cursors to page Differential queries, not offsets.

The trick here is that some queries are ordered. In these cases, we either need to pass some kind of tuple or do a cursor lookup. For example, if you are viewing revisions ordered by dateModified, we can either have the next page be something like:

?afterDateModified=2398329373&afterID=292&order=modified

...or some magical token:

?afterToken=2398329373:292&order=modified

I think we did this in Conpherence, but one factor there was that paging orders update with some frequency. In most cases, I think it's reasonable to pass just the ID and do a lookup to get the actual clause value (e.g., go look up object ID 292 and see what its dateModified is) and I think this is much simpler in general.

Test Plan: Set page size in Differential to 3, and paged through result lists ordered by date created and date modified.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603, T2625

Differential Revision: https://secure.phabricator.com/D6345

Details

Provenance
epriestleyAuthored on Jul 3 2013, 12:45 PM
Reviewer
btrahan
Differential Revision
Restricted Differential Revision
Parents
rP0c2e38e81c9c: Make DifferentialRevisionQuery policy-aware
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task
T603: Support permissions/policies in all Phabricator applications

Event Timeline