Automation activity log #91
Labels
No labels
bug
devops
duplicate
enhancement
good first issue
layout
next major release
next minor release
question
research
testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/fedi-feed-router#91
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Surface automation activity so the user can see what FFR has been doing without checking logs.
Context
With automated posting enabled, articles are fetched, validated, approved, and published without user intervention. Currently there's no in-app way to see this activity stream. The ActionPerformed event and LogActionListener exist but only write to the database — nothing surfaces this to the user.
Goals
Tasks
Implemented on
release/v1.4.0in six commits.Deviation from the ticket
The ticket referenced an
ActionLogmodel that does not exist, and assumed thelogstable could be filtered by action type — it cannot, it only hasleveland a free-textmessage.logsis also a general diagnostic log containing PHP TypeErrors and migration failures, so it is not a usable activity feed.A dedicated
activity_logstable was added instead, with a polymorphicsubjectand its ownActivityLoggedevent /RecordActivityListener. The existingActionPerformed→logspipeline is untouched.Not delivered as specified
"Link to the relevant article from each activity entry" is not a link. The Livewire
Articlescomponent has no#[Url]/query-string binding, so a deep link would be silently ignored. Entries instead show the article's feed name and, where present, the failure reason. Making this a real link needs query-string support onArticles— worth a follow-up ticket if wanted.Delivered
ActivityTypeEnum— fetch / validate / approve / reject / publish / erroractivity_logstable, model, factory; scopesofType/since/latestFirstActivitySummary— per-type counts for a window in one grouped queryActivitypage: paginated feed, type filter, date-range filter, 24h/7d countersCleanupActivityLogsJob— 90-day retention, daily (nothing pruneslogs)Bugs found and fixed along the way
Two duplicate-dispatch bugs, both pre-existing and unrelated to this feature:
AppServiceProvider::boot()and by Laravel 12 auto-discovery ofapp/Listeners. Everylogsrow was written twice, every article validated twice, and every approval ranPublishApprovedArticleListenertwice — duplicate-publish pressure that #123'sCache::lockwas absorbing.ExceptionOccurredwas dispatched twice — identicalreportable()callbacks in bothbootstrap/app.phpandAppServiceProvider::boot().Both are pinned by
EventListenerRegistrationTest.AppServiceProvider::boot()is now empty; exception reporting lives inbootstrap/app.phponly.Other behaviour changes
RouteArticle::reject()gained anisRejected()early-return guard, mirroring the existing one onapprove().Articles::clear()records one summary entry, not one per article.Verification
948 tests / 2502 assertions passing (909 before this ticket), Pint clean (303 files), PHPStan clean. Page rendered in a browser.