@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 an issue where an excessively long TTL was computed for "not attending anything" event caches

Summary:
Fixes T11894. Currently, if you aren't attending any events for a while, we can cache that you are free for the next 72 hours, even if you have an event in a few hours.

Instead, only cache "user is free" until the next event, if one exists.

Test Plan: Dumped cache TTLs, saw 52 minutes instead of ~4300 minutes with a near-upcoming event.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11894

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

+9
+9
src/applications/people/query/PhabricatorPeopleQuery.php
··· 498 498 'eventPHID' => null, 499 499 'availability' => null, 500 500 ); 501 + 502 + // Cache that the user is available until the next event they are 503 + // invited to starts. 501 504 $availability_ttl = $max_range; 505 + foreach ($events as $event) { 506 + $from = $event->getStartDateTimeEpochForCache(); 507 + if ($from > $cursor) { 508 + $availability_ttl = min($from, $availability_ttl); 509 + } 510 + } 502 511 } 503 512 504 513 // Never TTL the cache to longer than the maximum range we examined.