Skip to content

RelatedActivityLogSource emits type='activity_log' — type filter never matches 'related_activity_log' #11

@ManukMinasyan

Description

@ManukMinasyan

Summary

RelatedActivityLogSource::makeEntry() (src/Timeline/Sources/RelatedActivityLogSource.php) sets type: 'activity_log' on every entry — same value as ActivityLogSource. Users cannot filter the timeline to "only entries from related models' spatie logs" via ->ofType(['related_activity_log']).

Repro

$person->timeline()
    ->fromActivityLogOf(['emails'])
    ->ofType(['related_activity_log'])
    ->get();
// → empty collection (filter never matches)

Confusion

The source_priorities config has a related_activity_log key that DOES work — it sets the priority for RelatedActivityLogSource entries. So the priority axis and the entry-type axis disagree.

Recommended fix

Choose one (both are BC-breaking in different ways):

  1. Change RelatedActivityLogSource to emit type='related_activity_log' — restores symmetry with the priority-key axis. Breaks any user filtering on type='activity_log' to mean "all spatie log entries."
  2. Drop the priority key related_activity_log from config and accept that all spatie-log entries collide on a single "activity_log" type. Users who need to distinguish own- vs related-log entries do it via $entry->relatedModel === null.

Tracked by docs spec

Finding A2 in the upcoming docs restructure.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions