Skip to content

fix(auth): remove the post-login cache warmup that could never run - #138

Merged
fabiodalez-dev merged 1 commit into
mainfrom
fix/remove-dead-post-login-warm
Oct 13, 2026
Merged

fabiodalez-dev merged 1 commit into
mainfrom
fix/remove-dead-post-login-warm

Conversation

@fabiodalez-dev

@fabiodalez-dev fabiodalez-dev commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Problem

AuthController registered a shutdown hook at login that was meant to warm the page cache when it found expired entries. It checked $item['is_expired'], a key PageCacheService::getStats() never returns (the key is expired), so the hook has never done anything.

Fixing the key was not the right move: it would have made every login that finds an expired entry call clearAll() on the page cache and rebuild the home synchronously — on hosts without fastcgi_finish_request() that delays the login redirect, and it throws away entries that are still fresh.

Change

The hook is removed, along with its two now-unused imports and the README bullet that advertised it. It is not needed any more: invalidation is soft, each page is rebuilt single-flight on its next visit (#136, #137), and home and galleries are re-warmed after a content save.

Verification

  • Login on a local install: 302 to /admin, dashboard 200.
  • PHPUnit: 213 tests OK. PHPStan: no errors on app/. Semgrep: no new findings.
  • e2e: admin-csrf-resilience and album-edit-cache pass.

Summary by CodeRabbit

  • Modifiche
    • Dopo l’accesso amministrativo, le cache non vengono più svuotate né preriscaldate automaticamente.
    • Aggiornata la documentazione per riflettere questa modifica.

The shutdown hook registered at login looked for expired page-cache entries through an 'is_expired' key that getStats() never returns (the key is 'expired'), so it has never fired. Fixing the key would have made every login with an expired entry clear the whole page cache and rebuild the home synchronously.

It is not needed any more: invalidation is soft and each page is rebuilt single-flight on its next visit, with home and galleries re-warmed after a save. The README bullet that advertised it is dropped.
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8bb75b14-95fa-4491-91b0-3316233d8041
📥 Commits

Reviewing files that changed from the base of the PR and between f9a6cba and 41d3fb6.

📒 Files selected for processing (2)
  • README.md
  • app/Controllers/Admin/AuthController.php
💤 Files with no reviewable changes (2)
  • README.md
  • app/Controllers/Admin/AuthController.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Dopo un accesso amministrativo riuscito, il controller non avvia più il preriscaldamento delle cache. Il README non include più la relativa descrizione. La risposta di accesso continua a reindirizzare a /admin con stato 302 e intestazione X-Auth-Result: success.

Changes

Accesso amministrativo e cache

Layer / File(s) Summary
Rimozione del preriscaldamento post-accesso
app/Controllers/Admin/AuthController.php, README.md
Il controller non registra più il callback che controllava e preriscaldava le cache, né importa i servizi e il logger usati dal callback. Il README non descrive più il preriscaldamento dopo l’accesso amministrativo.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 41d3f

This removes dead post-login cache-warmup code and its documentation. Login behavior is unchanged: it still redirects to /admin. No merge-blocking risk remains.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed Il titolo descrive in modo chiaro e specifico la modifica principale: rimuovere il preriscaldamento della cache dopo l’accesso, poiché il meccanismo non poteva essere eseguito.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Un coniglio salta tra le cache ormai quiete
Le carote attendono, lucide e liete
Niente più corse dopo il login
La luna sorride dal giardino
E il coniglio riposa fino al mattino

Comment @coderabbitai help to get the list of available commands.

@fabiodalez-dev

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@fabiodalez-dev
fabiodalez-dev merged commit 1bb2c5a into main Oct 13, 2026
2 checks passed
@fabiodalez-dev
fabiodalez-dev deleted the fix/remove-dead-post-login-warm branch October 13, 2026 09:34
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