Homepage shows deactivated chapters (sidebar fragment invalidation deletes the wrong key)
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 30/100
Direzione di ricerca
Read app/components/chapters_sidebar_component.html.erb and the Chapter#expire_chapters_sidebar_cache callback described in the issue. Check how the sidebar fragment key is built and how Chapter.active.count can be included; the issue says this count is needed because direct SQL updates do not change updated_at. Done means chapter-set changes produce a fresh sidebar cache key; note that pull request #2994 is already open.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Deactivated chapters stay in the homepage chapter list. The chapter page 404s correctly and the subscriptions list is correct. Seen after several chapters were deactivated by setting active = false directly in the database.
The sidebar caches under a fixed key, and the callback that expires it deletes a key that does not exist:
app/components/chapters_sidebar_component.html.erbcallscache "chapters-sidebar". ActionView stores this asviews/chapters_sidebar_component/chapters-sidebar, plus the cache namespace.Chapter#expire_chapters_sidebar_cachedeleteschapters-sidebar, which resolves to a different entry. The delete has never matched, so no write path invalidates the fragment, not only direct database edits.
Fix: derive the cache key from the data so it changes whenever the chapter set changes. The key must include Chapter.active.count, because a plain SQL update that sets active does not bump updated_at.
Evidence
- The production cache store held one sidebar entry, last written 2026-09-13, under
views/chapters_sidebar_component/chapters-sidebar, and nochapters-sidebarentry. - Toggling
Chapter#update!in a productionrails runnerfired the callbacks and left the homepage unchanged. - Deleting the real entry refreshed the homepage at once.
- The fixed key is shared across locales. A derived key removes that side effect.
- The stale entry is cleared in production as of 2026-10-07. It will go stale again on the next chapter change until this is fixed.
- Lingua principale
- Ruby
- Stelle
- 105
- Fork
- 206
- Merge medio
- 1g 1h
- PR unite (30g)
- 78
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codebar/planner
-
DashboardQuery eager-loads workshop_host with :sponsors in one join (same host-loss trap as #2975)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codebar/planner
Issue simili
-
Local evaluation buckets percentage splits with the server key, so results differ from FlagsmithAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug priority: high
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
mitakarb/beerkeeper#1259 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno