Commit Graph

201 Commits (5ebc1af91e96ca065ea55f20e94de5d874a442c8)

Author SHA1 Message Date
Your Name 5ebc1af91e BATCH 1 1 week ago
Your Name e3b6cebf27 Fix MariaDB driver detection and reblog caption null inserts
Laravel 11 exposes MariaDB as a dedicated 'mariadb' driver, so
config('database.default') === 'mysql' checks silently misclassified
MariaDB as the non-mysql (postgres) branch.

- Add App\Util\Database\DatabaseDriver with isMysqlLike()/isPgsql()
  plus db_is_mysql_like()/db_is_pgsql() global helpers.
- Route all database.default driver checks through the helpers so
  MySQL and MariaDB are treated as one group.
- Use '' (not null) for share/compose caption+rendered, valid whether
  the column is nullable or NOT NULL (it is NOT NULL on MySQL/MariaDB).
- Guard pgsql strtolower() in registration against missing fields.
- Scope CustomEmoji::duplicateShortcodes to the grouped column for
  Postgres GROUP BY validity.
- Remove stale Postgres guard in status:dedup; use havingRaw for
  cross-driver HAVING.
2 weeks ago
Your Name 8a4567a5c2 Isolate fanout delivery failures from StatusDelete local cleanup 2 weeks ago
Shlee 78447646b8
Merge pull request #7253 from pixelfed/fix/remote-update-media-validate-before-orphan
Validate remote update attachments before detaching existing media
2 weeks ago
Your Name 9b829ca56e Validate remote update attachments before detaching existing media 2 weeks ago
Your Name 60284a871e Purge status_edits on account and status deletion 2 weeks ago
Your Name f1e4536d19 Invalidate notification cache when deleting a status 2 weeks ago
Daniel Supernault fbd52dd8fc
Improve federation handling 2 weeks ago
Daniel Supernault f371376789
Fix StatusDelete, handle StatusService deletion 2 weeks ago
Daniel Supernault 6e0d8454fd
Fix StatusDelete job, add logging 2 weeks ago
Your Name 9e14151228 Deliver posts regardless of profile no_autolink flag 2 weeks ago
Your Name 444c796bac Trigger StatusHashtag observer on deletion to keep cached_count accurate 2 weeks ago
Shlee aa152372c9
Merge pull request #7121 from shleeable/fix/status-remote-update-ssrf
Harden remote status update media fetch against SSRF
2 weeks ago
Your Name 856f2f8f2d Harden remote status update media fetch against SSRF 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).
4 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
Shlee b4afda12d5
Merge pull request #6889 from pixelfed/refactor/status-delete-http-client
refactor: replace Guzzle pool with Laravel HTTP client in StatusDelete
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 a142db87b4 polish 4 weeks ago
Your Name a0f721781a fix: improve NewStatusPipeline retry configuration
Previous config (timeout=5, tries=1) was too aggressive — a single
transient failure would permanently lose the status publication.

New config:
- timeout: 5 → 30 (sufficient for DB check + job dispatch)
- tries: 1 → 3 (recover from transient Redis/DB issues)
- maxExceptions: 1 (don't retry actual bugs)
- backoff: [5, 10] (exponential delay between retries)
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
Daniel Supernault 33dce75f2c
Pint app/ 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
Your Name edb4368b08 refactor: replace deprecated laravel/helpers with native alternatives
Replace all deprecated helper function calls:
- str_slug() → Str::slug()
- starts_with() → str_starts_with()
- ends_with() → str_ends_with()
- array_first() → Arr::first()
- array_last() → Arr::last()
- array_flatten() → Arr::flatten()

Remove laravel/helpers package from composer.json as it is no longer
needed and will not be maintained for Laravel 13.
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.
1 month ago
Shlee f858db840e
Update StatusTagsPipeline.php 1 month 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
Shlee 16d374aa08
Update StatusLocalUpdateActivityPubDeliverPipeline.php 9 months ago
Shlee 6ff0c899f0
Update StatusActivityPubDeliver.php 9 months ago
Daniel Supernault 53742fa699
Lint 9 months ago
Your Name 45a9a3b472 RemoveUnreachableStatementRector 11 months ago
dansup 03e64efd68
Merge pull request #6231 from shleeable/JobBatchv1-StatusPipeline
JobBatch v1- Status pipelines defensive checks
11 months ago
Your Name efb9db3eed StatusPipeline defensive checks 11 months ago
Shlee f8fbf3a9d5
Bugfix: Regression in NewStatusPipeline.php 11 months ago
dansup 0b5ce910b8
Merge branch 'staging' into fix-delay-publish-until-media-processed 11 months ago
Anil Kulkarni 8737619b46
Revert "Update NewStatusPipeline, replaces #5706"
This reverts commit 6c13debd56.
11 months ago
Anil Kulkarni 5c6e3b9732
Revert "Update NewStatusPipeline, improve fallback"
This reverts commit 863ad8e107.
11 months ago
Anil Kulkarni dbd2e17728
Ensure the cloud url is used when publishing a status to activitypub
Posting is done in two steps - first the media is uploaded and that begins a processing pipeline. When the media is finally
processed, the media pipeline sets the cdn_url to the final image (in the cloud if configured).
At any time, the user can click post. This begins a separate NewStatusPipeline to deliver the status over ActivityPub.
This causes a race. If the NewStatusPipeline runs before the media finishes processing, then the status is delivered with
the un-processed (and un-optimized images). If pixelfed is set to use cloud storage, then the ActivityPub message also incorrectly
uses the local media.

This commit fixes the race condition by waiting for all the media to be processed before sending the message over ActivityPub.
A new publish_delayed column is set per-post, indicating whether the
status should be delayed until all media is processed.

Then, the NewStatusPipeline is called twice per post -
When the media finishes processing and when the status is posted.

Both times, the pipeline will check to see if it's valid to post
If so, the pipeline will try to set publish_delayed to false
and only if it is the first time doing so, will it publish the post
11 months ago
Anil Kulkarni d819012439
Revert "Update NewStatusPipeline, replaces #5706"
This reverts commit 6c13debd56.
11 months ago
Anil Kulkarni 1a245914d8
Revert "Update NewStatusPipeline, improve fallback"
This reverts commit 863ad8e107.
11 months ago
Daniel Supernault 3686c92122
Update Status storage, add SanitizerService to fix spacing in html stripped content 1 year ago
Daniel Supernault 4ab85248e9
Update RemoteStatusDelete, fix decrement logic 1 year ago
Daniel Supernault 863ad8e107
Update NewStatusPipeline, improve fallback 2 years ago
Daniel Supernault 6c13debd56
Update NewStatusPipeline, replaces #5706 2 years ago