Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Homepage shows deactivated chapters (sidebar fragment invalidation deletes the wrong key)

Aperta
#2,993 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mroderick ci sta già lavorando.

Dal 7/10/2026.

  • #2994 di @mroderick — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
rails, ruby
Ambito
backend

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.erb calls cache "chapters-sidebar". ActionView stores this as views/chapters_sidebar_component/chapters-sidebar, plus the cache namespace.
  • Chapter#expire_chapters_sidebar_cache deletes chapters-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 no chapters-sidebar entry.
  • Toggling Chapter#update! in a production rails runner fired 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codebar/planner

Tutte le issue di codebar/planner

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.