Summary
RelatedActivityLogSource::resolve() (src/Timeline/Sources/RelatedActivityLogSource.php, line 36) calls $subject->{$relation}()->get() with no limit before querying the activity log. For a subject with thousands of related rows (e.g., a Person with many tasks), this loads every related row into memory just to derive the subject pairs for the activity-log query.
Repro
// Person with 10,000 tasks
$person->timeline()
->fromActivityLogOf(['tasks'])
->paginate(perPage: 20);
// Loads all 10,000 task rows even though paginator only needs 20 entries
Recommended fix
Add ->limit($window->cap) to the related-row fetch:
$rows = $subject->{$relation}()->limit($window->cap)->get();
The activity-log query is already capped via ->limit($window->cap); the related-row fetch should match.
Tracked by docs spec
Finding C1 in the upcoming docs restructure.
Summary
RelatedActivityLogSource::resolve()(src/Timeline/Sources/RelatedActivityLogSource.php, line 36) calls$subject->{$relation}()->get()with no limit before querying the activity log. For a subject with thousands of related rows (e.g., a Person with many tasks), this loads every related row into memory just to derive the subject pairs for the activity-log query.Repro
Recommended fix
Add
->limit($window->cap)to the related-row fetch:The activity-log query is already capped via
->limit($window->cap); the related-row fetch should match.Tracked by docs spec
Finding C1 in the upcoming docs restructure.