Commit Graph

57 Commits (444c796bac5e618f9fcfe523f65f7fee87d805aa)

Author SHA1 Message Date
Your Name 444c796bac Trigger StatusHashtag observer on deletion to keep cached_count accurate 2 weeks ago
Your Name 6e7419bb96 Fix StatusDelete crashing on soft-deleted owning profile 2 weeks ago
Your Name c4e5b96d25 Stream deletions with cursor and batch notification lookups in delete jobs
The status- and account-deletion jobs loaded whole collections with
->get() and then looped, running a per-row Notification lookup inside
each iteration.

- StatusDelete / RemoteStatusDelete: resolve associated DirectMessage and
  MediaTag ids, fetch their notifications in a single whereIn query,
  clear each via cursor (NotificationService::del must run per row for
  cache/redis cleanup), then bulk delete the DMs and media tags.
- DeleteAccountPipeline / DeleteRemoteProfilePipeline: stream Story and
  Collection deletions with cursor() instead of loading every row into
  memory. Per-row file unlink and item deletes are preserved.

Adds StatusDeleteCleanupTest covering DM + notification cleanup, media
tag + notification cleanup, and the no-associations case.
3 weeks ago
Your Name 69869536a1 Fix remote status deletion leaking attached media, add status:media command
MediaDeletePipeline skips deletion when media->status_id is set. status_id has
no FK/cascade, so deleting a status never clears it, and the delete jobs
dispatched by the status-delete paths were always skipped, leaking media files.

Detach media (status_id = null) before dispatching the delete in StatusDelete,
RemoteStatusDelete and DeleteRemoteStatusPipeline, so the row is genuinely
orphaned by the time the guard checks it and the deletion proceeds.

Also adds a status:media diagnostic command that dumps all metadata for a
media id (DB columns, computed URLs, attachment state, parent status including
the dangling status_id case, owner, metadata, and an optional live URL check).
3 weeks ago
Your Name e7b70c6084 refactor: extract duplicate patterns into shared methods
1. Add FractalService with static item() and collection() helpers
   replacing 22 call sites that repeated the 4-line Fractal Manager
   + ArraySerializer boilerplate.

2. Add AccountInterstitial::createFromStatus() factory method
   consolidating 4 identical 15-line blocks that create interstitials
   with status metadata.

3. Add NotificationService::createNotification() to handle the
   repeated pattern of creating, caching, and registering a
   notification in the recipient's feed.

4. Add NotificationService::firstOrCreateNotification() for
   idempotent notifications (share/boost, mention) that should
   only notify once per actor+action+item combination.
4 weeks ago
Your Name 9c9e2a5a22 refactor: extract shared ActivityPub pool delivery into ActivityPubDeliveryService
Add ActivityPubDeliveryService::pool() using Laravel's Http::pool() to
consolidate the duplicated delivery pattern found across 10 jobs.

Updated jobs:
- StatusActivityPubDeliver
- StatusDelete
- StatusLocalUpdateActivityPubDeliverPipeline
- FanoutDeletePipeline
- SharePipeline
- UndoSharePipeline
- StoryFanout
- StoryExpire
- StoryDelete
- ProfileMigrationDeliverMoveActivityPipeline

The shared method accepts a Profile (sender), audience (inbox URLs),
and activity (payload array), handling signing, user-agent, timeout,
and concurrency in one place. No direct Guzzle usage remains in
app/Jobs/.
4 weeks ago
Shlee f018004b56
Merge pull request #6892 from pixelfed/refactor/move-models-to-namespace
Refactor/move models to namespace
4 weeks ago
Your Name c0cde2f682 refactor: move 52 legacy models from App\ to App\Models\
Move all Eloquent models from the app/ root directory to app/Models/
for consistency with modern Laravel conventions. The project already had
54 models in App\Models; this migrates the remaining 52 legacy models.

Changes:
- Move 52 model files from app/ to app/Models/
- Update namespace declarations in each model
- Update all ~1000 import references across the codebase
- Add Relation::morphMap() in AppServiceProvider for backward
  compatibility with existing polymorphic database records
- Add missing HasSnowflakePrimary imports for models that relied
  on same-namespace resolution
4 weeks ago
Your Name 00dd5b3d92 refactor: replace Guzzle pool with Laravel HTTP client in StatusDelete
Replace direct GuzzleHttp\Client and Pool usage in fanoutDelete()
with Laravel's Http::pool() facade. This provides:

- Testability via Http::fake() in tests
- Consistent timeout/retry configuration
- No direct Guzzle dependency in application code
- Proper integration with Laravel's HTTP client features
4 weeks ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Shift 19880c2ffb
Convert string references to `::class`
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
4 weeks ago
Shlee 6959dd46db
Update StatusDelete.php 7 months ago
Shlee 1466d4ef7b
Update StatusDelete.php 7 months ago
Shlee 971050b134
Update StatusDelete.php 7 months ago
Daniel Supernault 53742fa699
Lint 9 months ago
Your Name efb9db3eed StatusPipeline defensive checks 11 months ago
Daniel Supernault 5071aaf408
Update activitpub setting, use config_cache() 3 years ago
Daniel Supernault 1be21c76f3
Fix StatusHashtag delete bug 3 years ago
Daniel Supernault fcbcd7ec73
Update Delete pipelines, delete status hashtags quietly 3 years ago
Daniel Supernault 4c95306f12
Update StatusPipeline, fix Direct and Story notification deletion 3 years ago
Daniel Supernault ce54d29c69
Update delete pipelines, properly invoke StatusHashtag delete events 3 years ago
Daniel Supernault ae6dd4e3a2
Update pipeline dispatch, replace dispatchSync with dispatch 3 years ago
Daniel Supernault b1f95a7213
Bump laravel, v9 => v10 3 years ago
Daniel Supernault 467c9d754e
Update atom feed, improve cache expiry and fix double encoding bug. Fixes #4121 4 years ago
Daniel Supernault 5a5d00b947
Update ap pipelines 4 years ago
Daniel Supernault 164aa5779a
Update StatusReplyPipeline, fix comment counts 4 years ago
Daniel Supernault e029d09c8a
Update StatusDelete pipeline 4 years ago
Daniel Supernault 52879826fa
Update StatusDelete pipeline 4 years ago
Daniel Supernault 257c094911
Update StatusDelete pipeline, dispatch async 4 years ago
Daniel Supernault 1cdc0fe8ed
Update delete pipelines 4 years ago
Daniel Supernault 04e8c96a7e
Update status deletion, fix database lock issues and side effects 4 years ago
Daniel Supernault 44f4a9edd9
Improve CollectionService cache invalidation, fixes #3548 4 years ago
noellabo 74cc41d4fa Add Content-Type and User-Agent for activity delivery 4 years ago
Daniel Supernault 1c20d6960a
Update MediaStorageService, fix reremote avatar bug 5 years ago
Daniel Supernault f47161fcd9
Update StatusDeletePipeline 5 years ago
Daniel Supernault 53134208fe
Update config() to config_cache() 5 years ago
Daniel Supernault 9fd90e174b
Update StatusDeletePipeline, use StorageMediaService for media deletes 6 years ago
Daniel Supernault 3f772ff864
Update StatusDelete pipeline, call StatusService::del() to remove status from cache 6 years ago
Daniel Supernault f930c4bda2
Update StatusDelete pipeline, fix object storage thumbnail deletion 6 years ago
Daniel Supernault 4b1a0fd750
Update StatusDelete job, handle cloud storage media deletes 6 years ago
Daniel Supernault 6dcd472be6
Update Profile, fix status count 6 years ago
Daniel Supernault 63eceb8236
Update delete handler 6 years ago
Daniel Supernault a5019b8907
Update StatusController 6 years ago
Daniel Supernault 881fa86573
Update NotificationTransformer, handle tagged deletes 6 years ago
Daniel Supernault b86a9d9524
Update StatusPipeline 7 years ago
Daniel Supernault 015c2f9954
Update StatusPipeline 7 years ago
Daniel Supernault 0077544779
Update StatusDelete 7 years ago
Daniel Supernault 0ce65865c6
Update StatusPipeline 7 years ago
Daniel Supernault 0d73a57d75
Update StatusDeletePipeline, make async 8 years ago
Daniel Supernault 66d525dde5
Update StatusDelete pipeline, fanout via AP if enabled 8 years ago