Homepage shows deactivated chapters (sidebar fragment invalidation deletes the wrong key)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 30/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Ruby
- Estrellas
- 105
- Forks
- 206
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 78
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codebar/planner
-
DashboardQuery eager-loads workshop_host with :sponsors in one join (same host-loss trap as #2975)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Los mantenedores suelen responder en 1 día
Todos los issues de codebar/planner
Issues similares
-
[KLayout][DRC] Gat.b1 only checks gate regions, misses facing 3.3 V poly end caps (Figure 5.6)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
IHP-GmbH/IHP-Open-PDK#1266 ·
Los mantenedores suelen responder en 2 días
-
Source Support
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
we-promise/sure#4056 ·
Los mantenedores suelen responder en 1 día
-
Refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
valkey-io/valkey-glide-ruby#347 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 5 días