Commit Graph

4604 Commits (08a442e6617e05b26c890d9b47400f2e2767e984)

Author SHA1 Message Date
Your Name 5a9c235922 Backfill storage_used on upgrade via queued job + data migration
Repair accounts whose storage counter drifted before the self-heal logic
existed (#7169). A data migration dispatches RecalculateAllUserStoragePipeline
to the low queue so the deploy is not blocked while every user is recomputed
from source. The job is unique and idempotent, so re-runs are harmless.

- RecalculateAllUserStoragePipeline: chunked recalc of all active users
- Migration dispatches the job (no inline heavy work during deploy)
- Test covers bulk recalculation from actual media
2 weeks ago
Your Name 61a1c30756 Self-heal stale storage_used on read to unblock stuck accounts
UserStorageService::get() now recalculates from source when the cached
counter is missing or older than STALE_AFTER_HOURS, instead of returning a
possibly-inflated cached value. This is what unblocks a user stuck at the
account size limit: the limit check on their next upload attempt reads the
freshly recalculated real usage rather than the drifted value (#7169).

The upload flow reads get() and enforces the limit BEFORE the write-path
heal runs, so a blocked user could never self-heal via upload/delete alone.
Healing on read closes that gap and makes the scheduled reconciler a
belt-and-suspenders safety net rather than a requirement.

A fresh counter is still trusted as-is (no per-read SUM). Adds tests for the
stale-get recompute and fresh-get trust paths.
2 weeks ago
Your Name 10559c23e3 Fix larastan noAuthFacadeInRequestScope in LoginController
Replace Auth::check() with $request->user() !== null in confirmEmail(),
which already has the request in scope, and drop the now-unused Auth
facade import. Resolves the 2 remaining project-wide larastan errors.
2 weeks ago
Your Name f467dc04d5 Remove unused CACHE_KEY constant from UserStorageService
The constant was never referenced; the service reads and writes the
storage_used column directly on the User model rather than via cache.
2 weeks ago
Your Name 26d3e8bb8e Self-heal stale storage_used on upload/delete hot path
Make increaseStorageUsed/decrementStorageUsed recalculate from source when
the cached counter is older than STALE_AFTER_HOURS (168h) or never
calculated, so an affected user is corrected the next time they upload or
delete without waiting for the nightly reconciler. Callers save/delete the
media row before calling these, so the from-source recalc already reflects
the change and the incremental delta is skipped on the recalc path.

- Add UserStorageService::STALE_AFTER_HOURS and isStale() helper (no extra
  query: reads the already-loaded model), with defensive Carbon parsing
- Cast users.storage_used_updated_at to datetime so freshness comparisons
  work on a Carbon instance
- Add tests for stale/fresh/never-calculated increase and decrement paths
2 weeks ago
Your Name 6496904293 Fix account storage limit not freeing on media deletion (#7169)
users.storage_used only ever grew: uploads incremented it but no deletion
path decremented it, so users hit the account size limit even when their
real media usage was well below it.

- Decrement storage_used in MediaDeletePipeline when media is removed
- Add UserStorageService::increaseStorageUsed / decrementStorageUsed as the
  fast, symmetric hot-path counter updates (floor-based, clamped at zero)
- Refactor the 6 upload call sites to use increaseStorageUsed instead of
  duplicated inline writes (also fixes ceil/floor drift vs the reconciler)
- Add (user_id, size) covering index so per-user SUM(size) is not a full
  table scan (INPLACE/LOCK=NONE, skipped on sqlite)
- Add user:storage:recalculate command to repair affected accounts, with a
  daily --stale=168 scheduled reconciler to correct any drift
- Add regression tests for the pipeline and UserStorageService
2 weeks ago
Daniel Supernault edcf978755
Update AccountTransformer.php 2 weeks ago
Daniel Supernault 194c881cb2
Update ResetPasswordController 2 weeks ago
Daniel Supernault 1d96c94054
Refactor Auth, remove expensive middleware 2 weeks ago
Daniel Supernault 57e7eef082
Fix StoryIndexService 2 weeks ago
Daniel Supernault 13aa36efb4
Update ApiV1Controller.php 2 weeks ago
Shlee 519b1b94dc
Refactor comments in DangerZone middleware
Removed redundant comments to clarify code functionality.
2 weeks ago
Shlee 5d38faa257
Merge pull request #7166 from shleeable/fix/dangerzone-logout-clear-2fa-session
Invalidate session on DangerZone forced logout to clear 2FA state
2 weeks ago
Your Name 58e8a4922d Invalidate session on DangerZone forced logout to clear 2FA state 2 weeks ago
Shlee e60082b9b9
Merge pull request #7165 from shleeable/fix/media-blocklist-indexed-lookup
Use indexed query for media blocklist lookups and allow removing inactive hashes
2 weeks ago
Your Name e8f2b06afe Use indexed query for media blocklist lookups and allow removing inactive hashes 2 weeks ago
Shlee 9cf879d375
Merge pull request #7163 from shleeable/fix/status-lexer-no-autolink-fanout
Deliver posts regardless of profile no_autolink flag
2 weeks ago
Your Name 9e14151228 Deliver posts regardless of profile no_autolink flag 2 weeks ago
Your Name 742c1a6bc8 Require dangerzone sudo mode on curated register, shadow filter and page admin controllers 2 weeks ago
Shlee 97b5d2f180
Merge pull request #7159 from shleeable/fix/directory-exclude-private-profiles
Exclude private profiles from public directory and clear suggestable on going private
2 weeks ago
Your Name 1581863093 Exclude private profiles from public directory and clear suggestable on going private 2 weeks ago
Shlee 903c191f10
Merge pull request #7158 from shleeable/fix/2fa-logout-session-cleanup
Clear 2FA session state on forced logout after failed attempts
2 weeks ago
Your Name 97f1a097ff Clear 2FA session state on forced logout after failed attempts 2 weeks ago
Shlee eaadf425f2
Merge pull request #7157 from shleeable/fix/dangerzone-oidc-per-user
Scope DangerZone OIDC sudo bypass to OIDC-registered users
2 weeks ago
Your Name 7483a4b05b Scope DangerZone OIDC sudo bypass to OIDC-registered users 2 weeks ago
Shlee 72f0990dd8
Merge pull request #7156 from shleeable/fix/network-timeline-null-account
Filter null-account statuses from non-cached network timeline
2 weeks ago
Shlee e65a17c175
Merge pull request #7155 from shleeable/fix/get-or-fetch-remote-profile-fallback
Fall back to stored profile when remote refresh fails
2 weeks ago
Your Name 917a13d4a7 Filter null-account statuses from non-cached network timeline 2 weeks ago
Your Name 73fb5ed696 Fall back to stored profile when remote refresh fails 2 weeks ago
Your Name 444c796bac Trigger StatusHashtag observer on deletion to keep cached_count accurate 2 weeks ago
Shlee fc80bce460
Update StoryApiV1Controller.php 2 weeks ago
Shlee 5bd33640fe
Merge pull request #7151 from shleeable/fix/status-dedupe-deterministic
Deterministically keep earliest status per uri in dedupe command
2 weeks ago
Your Name e360fab619 Deterministically keep earliest status per uri in dedupe command 2 weeks ago
Shlee 189408edf0
Merge pull request #7149 from shleeable/fix/authorize-interaction-intended-redirect
Use intended-redirect session for authorize_interaction guest login
2 weeks ago
Your Name 0234a305ae Use intended-redirect session for authorize_interaction guest login 2 weeks ago
Your Name 1ffda3eba9 Federate unlike before deleting Like so retries can deliver 2 weeks ago
Shlee 46fb9613e3
Merge pull request #7146 from shleeable/fix/2fa-checkpoint-throttle
Rate limit and audit-log 2FA checkpoint verification
2 weeks ago
Your Name 8cebb24c04 Rate limit and audit-log 2FA checkpoint verification 2 weeks ago
Shlee 0ebe1f8fb1
Merge pull request #7145 from shleeable/fix/media-blocklist-check-before-store
Check media blocklist before storing uploads to prevent orphaned files
2 weeks ago
Your Name ec6827bae2 Check media blocklist before storing uploads to prevent orphaned files 2 weeks ago
Shlee cecdad5b53
Merge pull request #7143 from shleeable/fix/search-controller-pgsql-ilike
Use ILIKE for case-insensitive search on PostgreSQL
2 weeks ago
Your Name 613cf413de Use ILIKE for case-insensitive search on PostgreSQL 2 weeks ago
Shlee 173abef5c5
Merge pull request #7142 from shleeable/fix/reblog-duplicate-dispatch
Only dispatch SharePipeline for newly-created reblogs
2 weeks ago
Your Name d190ba7b66 Only dispatch SharePipeline for newly-created reblogs 2 weeks ago
Shlee 0fc121b685
Merge pull request #7134 from shleeable/fix/storyfetch-ssrf
Route StoryFetch outbound requests through SSRF-hardened fetch service
2 weeks ago
Shlee 58c83a2c6b
Merge pull request #7141 from shleeable/fix/import-instagram-missing-profile
Drop Instagram import job when profile is missing instead of crashing
2 weeks ago
Your Name 922d7f766e Drop Instagram import job when profile is missing instead of crashing 2 weeks ago
Shlee ee64de9df4
Merge pull request #7140 from shleeable/fix/user-account-delete-user-agent
Send Pixelfed User-Agent on federated account deletion deliveries
2 weeks ago
Shlee a5cbea834f
Merge pull request #7138 from shleeable/fix/oob-authorize-omitted-redirect-uri
Detect OOB oauth client when redirect_uri omitted on authorize
2 weeks ago
Shlee ae31ed8e66
Merge pull request #7137 from shleeable/fix/story-remote-expiry-cache
Invalidate latest-story cache on remote story expiry and null-guard l…
2 weeks ago