Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15403710
D20318.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20318.diff
View Options
diff --git a/src/applications/conpherence/query/ConpherenceThreadQuery.php b/src/applications/conpherence/query/ConpherenceThreadQuery.php
--- a/src/applications/conpherence/query/ConpherenceThreadQuery.php
+++ b/src/applications/conpherence/query/ConpherenceThreadQuery.php
@@ -285,23 +285,35 @@
}
private function loadTransactionsAndHandles(array $conpherences) {
- $query = id(new ConpherenceTransactionQuery())
- ->setViewer($this->getViewer())
- ->withObjectPHIDs(array_keys($conpherences))
- ->needHandles(true);
+ // NOTE: This is older code which has been modernized to the minimum
+ // standard required by T13266. It probably isn't the best available
+ // approach to the problems it solves.
+
+ $limit = $this->getTransactionLimit();
+ if ($limit) {
+ // fetch an extra for "show older" scenarios
+ $limit = $limit + 1;
+ } else {
+ $limit = 0xFFFF;
+ }
+
+ $pager = id(new AphrontCursorPagerView())
+ ->setPageSize($limit);
// We have to flip these for the underlying query class. The semantics of
// paging are tricky business.
if ($this->afterTransactionID) {
- $query->setBeforeID($this->afterTransactionID);
+ $pager->setBeforeID($this->afterTransactionID);
} else if ($this->beforeTransactionID) {
- $query->setAfterID($this->beforeTransactionID);
+ $pager->setAfterID($this->beforeTransactionID);
}
- if ($this->getTransactionLimit()) {
- // fetch an extra for "show older" scenarios
- $query->setLimit($this->getTransactionLimit() + 1);
- }
- $transactions = $query->execute();
+
+ $transactions = id(new ConpherenceTransactionQuery())
+ ->setViewer($this->getViewer())
+ ->withObjectPHIDs(array_keys($conpherences))
+ ->needHandles(true)
+ ->executeWithCursorPager($pager);
+
$transactions = mgroup($transactions, 'getObjectPHID');
foreach ($conpherences as $phid => $conpherence) {
$current_transactions = idx($transactions, $phid, array());
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 4:36 AM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7710633
Default Alt Text
D20318.diff (1 KB)
Attached To
Mode
D20318: Fix an unusual internal cursor in Conpherence
Attached
Detach File
Event Timeline
Log In to Comment