Skip to content

Queue new plugin notifications via a dedicated job#356

Merged
simonhamp merged 1 commit intomainfrom
batch-plugin-approval-notif
Apr 13, 2026
Merged

Queue new plugin notifications via a dedicated job#356
simonhamp merged 1 commit intomainfrom
batch-plugin-approval-notif

Conversation

@simonhamp
Copy link
Copy Markdown
Member

Summary

  • Moves the NewPluginAvailable notification fan-out from Plugin::approve() into a new SendNewPluginNotifications queued job
  • Previously, approving a plugin iterated through all opted-in users synchronously during the HTTP request, queuing individual notifications one-by-one — this blocked the admin UI
  • Now a single job is dispatched, and the fan-out happens on the queue worker

Changes

  • New: app/Jobs/SendNewPluginNotifications.php — queued job that queries opted-in users and sends NewPluginAvailable notifications
  • Updated: Plugin::approve() — dispatches the job instead of inline Notification::send()
  • Updated: NewPluginAvailableTest — integration tests now assert the job is dispatched via Bus::fake()
  • New: SendNewPluginNotificationsTest — dedicated tests for the job's notification logic

Test plan

  • Job sends notifications to opted-in users
  • Job excludes the plugin author
  • Job is dispatched on first approval
  • Job is not dispatched on re-approval
  • All existing notification tests still pass

🤖 Generated with Claude Code

Move the notification fan-out from Plugin::approve() into a
SendNewPluginNotifications job so the admin UI isn't blocked
iterating through every opted-in user during approval.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simonhamp simonhamp marked this pull request as ready for review April 13, 2026 00:50
@simonhamp simonhamp merged commit 8c12845 into main Apr 13, 2026
2 checks passed
@simonhamp simonhamp deleted the batch-plugin-approval-notif branch April 13, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant