@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix some minor Calendar issues, including a paging issue on imports

Summary:
Fixes T11808. I couldn't reproduce the issue there locally so I'm just cheating a little bit until a better reproduction case shows up.

We don't need to do a full load here anyway, and testing for any row is more efficient.

Test Plan: Poked around imports without issues, but couldn't reproduce this problem locally.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11808

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

+18 -9
+14 -6
src/applications/calendar/import/PhabricatorCalendarImportEngine.php
··· 225 225 $xactions[$full_uid] = $this->newUpdateTransactions($event, $node); 226 226 $update_map[$full_uid] = $event; 227 227 228 + $attendee_map[$full_uid] = array(); 228 229 $attendees = $node->getAttendees(); 229 230 $private_index = 1; 230 231 foreach ($attendees as $attendee) { ··· 526 527 ->setStartDateTime($start_datetime) 527 528 ->setEndDateTime($end_datetime); 528 529 529 - $event->setIsAllDay($start_datetime->getIsAllDay()); 530 + $event->setIsAllDay((int)$start_datetime->getIsAllDay()); 530 531 531 532 // TODO: This should be transactional, but the transaction only accepts 532 533 // simple frequency rules right now. ··· 551 552 PhabricatorUser $viewer, 552 553 PhabricatorCalendarImport $import) { 553 554 554 - $any_event = id(new PhabricatorCalendarEventQuery()) 555 - ->setViewer($viewer) 556 - ->withImportSourcePHIDs(array($import->getPHID())) 557 - ->setLimit(1) 558 - ->execute(); 555 + $table = new PhabricatorCalendarEvent(); 556 + $conn = $table->establishConnection('r'); 557 + 558 + // Using a CalendarEventQuery here was failing oddly in a way that was 559 + // difficult to reproduce locally (see T11808). Just check the table 560 + // directly; this is significantly more efficient anyway. 561 + 562 + $any_event = queryfx_all( 563 + $conn, 564 + 'SELECT phid FROM %T WHERE importSourcePHID = %s LIMIT 1', 565 + $table->getTableName(), 566 + $import->getPHID()); 559 567 560 568 return (bool)$any_event; 561 569 }
+3 -2
src/applications/calendar/notifications/PhabricatorCalendarNotificationEngine.php
··· 155 155 $sent_map[$event_phid][$target_phid][$initial_epoch] = $row; 156 156 } 157 157 158 - $notify_min = $cursor; 159 - $notify_max = $cursor + $this->getNotifyWindow(); 158 + $now = PhabricatorTime::getNow(); 159 + $notify_min = $now; 160 + $notify_max = $now + $this->getNotifyWindow(); 160 161 $notify_map = array(); 161 162 foreach ($events as $key => $event) { 162 163 $initial_epoch = $event->getUTCInitialEpoch();
+1 -1
src/applications/calendar/query/PhabricatorCalendarEventQuery.php
··· 126 126 return array( 127 127 'start' => array( 128 128 'table' => $this->getPrimaryTableAlias(), 129 - 'column' => 'dateFrom', 129 + 'column' => 'utcInitialEpoch', 130 130 'reverse' => true, 131 131 'type' => 'int', 132 132 'unique' => false,