Page MenuHomePhabricator

Fix an issue where querying for a large number of projects by slug could paginate incorrectly
ClosedPublic

Authored by epriestley on Jul 9 2020, 5:47 PM.
Tags
None
Referenced Files
F15462395: D21399.diff
Tue, Apr 1, 2:52 PM
F15457755: D21399.id50937.diff
Sun, Mar 30, 6:28 PM
F15453720: D21399.id50936.diff
Sat, Mar 29, 1:51 PM
F15445526: D21399.id.diff
Thu, Mar 27, 2:21 PM
F15439827: D21399.diff
Wed, Mar 26, 9:40 AM
F15436049: D21399.id.diff
Tue, Mar 25, 11:39 AM
F15432043: D21399.id50936.diff
Mon, Mar 24, 3:56 PM
F15429660: D21399.id50936.diff
Mon, Mar 24, 3:30 AM
Subscribers
None

Details

Summary

See PHI1809. This query may join the "slug" table, but each project may have multiple slugs, and the query does not "GROUP BY" when this join occurs.

This may lead to partial result sets and unusual paging behavior.

This could likely be caught categorically in loadAllFromArray(); I'll adjust this in a followup.

Test Plan

A minimal reproduction case is something like:

  • Give project P slugs: a, b, c.
  • Give project Q slugs: d.
  • Query for slugs: a, b, c, d; with limit 2.
  • Order the query so P returns first.
  • Expect: P and Q.
  • Actual: P generates 3 raw rows and the final result is just P with no pagination cursor.

Diff Detail

Repository
rP Phabricator
Branch
project1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24755
Build 34140: Run Core Tests
Build 34139: arc lint + arc unit