Commit Graph

13325 Commits (61c087e56009e2b19489552f3992114282a3adf5)
 

Author SHA1 Message Date
Your Name 61c087e560 Extract scheduled tasks into routes/scheduledtasks.php
Move the schedule definitions out of the withSchedule() closure in
bootstrap/app.php into a dedicated routes/scheduledtasks.php, required with
the Schedule instance in scope. Behavior-preserving; verified with
schedule:list.
2 weeks ago
Your Name 4f284e0893 Gate storage reconciler schedule behind a disabled-by-default flag
The upload/delete/read paths now self-heal stale storage_used counters and
the upgrade backfill migration repairs existing accounts, so the weekly
reconciler is no longer required. Gate it behind pixelfed.account_storage_
reconcile (ACCOUNT_STORAGE_RECONCILE), defaulting off, so operators can opt
in to the background hygiene job without editing source.
2 weeks ago
Your Name 007f97f987 Expand test coverage for storage_used improvements
- Suspended/missing user guards for get, increase, decrement, recalculate
- Staleness window boundary (fresh at N-1h, stale at N+1h)
- Sub-1000-byte rounding on increase/decrement (floor to KB)
- Command --stale filter (only recomputes stale/never-calculated users) and
  missing --user id failure
- Migration dispatches the backfill job to the low queue (Bus::fake)
2 weeks ago
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 28573e863f Run storage recalculate reconciler weekly instead of daily
Now that the upload/delete hot path and get() self-heal stale counters, the
scheduled reconciler is a background drift safety net rather than the primary
unblock mechanism, so weekly is sufficient.
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 319905848f
Merge pull request #7168 from pixelfed/shleeable-patch-1
Delete larastan
2 weeks ago
Shlee 171a027c56
Delete larastan 2 weeks ago
Shlee 86b79d3605
Merge pull request #7167 from pixelfed/shleeable-patch-1
Refactor comments in DangerZone middleware
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
Shlee f81ba9b8d8
Merge pull request #7161 from shleeable/fix/admin-controllers-dangerzone-middleware
Require dangerzone sudo mode on curated register, shadow filter and page admin controllers
2 weeks ago
Your Name 742c1a6bc8 Require dangerzone sudo mode on curated register, shadow filter and page admin controllers 2 weeks ago
Shlee 8cd35ce073
Merge pull request #7160 from shleeable/chore/lint-session-tests-2
lint
2 weeks ago
Your Name 68becbe2cc lint 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
Shlee edb06f6223
Merge pull request #7154 from shleeable/fix/statushashtag-observer-cached-count
Trigger StatusHashtag observer on deletion to keep cached_count accurate
2 weeks ago
Your Name 444c796bac Trigger StatusHashtag observer on deletion to keep cached_count accurate 2 weeks ago
Shlee 057648778b
Merge pull request #7152 from pixelfed/shleeable-patch-1
Add block check to story comment
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
Shlee c13b8a23bd
Merge pull request #7148 from shleeable/fix/unlike-federate-before-delete
Federate unlike before deleting Like so retries can deliver
2 weeks ago
Your Name 1ffda3eba9 Federate unlike before deleting Like so retries can deliver 2 weeks ago
Shlee ca4ad83255
Merge pull request #7147 from shleeable/chore/lint-session-tests
Apply Pint lint fixes to session test files
2 weeks ago