Homec4science

Fix a bug where policy queries with cursor-based pagers and non-ID orders can…

Authored by epriestley <git@epriestley.com> on Sep 22 2013, 01:23.

Description

Fix a bug where policy queries with cursor-based pagers and non-ID orders can go into infinite loops

Summary:
Ref T603. See inlines for an explanation. The case where I hit this was loading the "Pending Differential Revisions" panel in Diffusion when logged out, after making a repository public.

What happens is that we load 10 revisions (say, D1 .. D10) but the user can't see any of them. We then try to load the next 10, but since the pagination is ordered by date modified, we need to base the next query on the modified date of the last thing we loaded (D10). However, since we use the viewer's policies to load that cursor object, it fails to load, and then we just issue the same query over and over again, loading D1 .. D10 until we run out of execution time.

Test Plan: Interface now loads correctly.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

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

Details

Committed
epriestley <git@epriestley.com>Sep 22 2013, 01:23
Pushed
aubortJan 31 2017, 17:16
Parents
rPH63818818cb67: Allow repositories to be activate/deactivated in a transaction-aware way
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHe7a7e43104bc: Fix a bug where policy queries with cursor-based pagers and non-ID orders can… (authored by epriestley <git@epriestley.com>).Sep 22 2013, 01:23