Ahoy lifecycle tracking silently drops changes made with no Current actor
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Comienza en ApplicationController, Events::CalloutsController y Analytics::LifecycleBuffer para rastrear cómo se establece Current.source y cuándo se vacían los eventos del ciclo de vida. Reproduce el flujo de scholarship agreement con la sesión cerrada y una escritura de modelo fuera de una solicitud, y añade specs enfocadas que muestren que la acción pública se atribuye y que el comportamiento fuera de una solicitud se gestiona explícitamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🤖 From Claude:
AhoyTrackable (included in ApplicationRecord) tracks create/update/destroy for every model, but track_lifecycle_event opens with:
return unless Current.user || Current.source
Current.user is only set for a signed-in request (ApplicationController#set_current_user), and Current.source is set in exactly two places (public_forms_controller, events/public_registrations_controller). Everything else that writes without a signed-in user leaves no trace at all — no event, no error, no log line.
Verified
Calling scholarship.accept_agreement!(by: "recipient") with no actor set:
| Actor | Buffered events |
|---|---|
| none | [] |
Current.user set |
update.scholarship, create.scholarship_agreement_response |
Current.source set |
update.scholarship, create.scholarship_agreement_response |
Where this bites today
- Scholarship accept/decline on the public callout.
Events::CalloutsControllerdoesskip_before_action :authenticate_user!and never setsCurrent.source, so a logged-out recipient accepting or declining their agreement produces no Ahoy event. The bespokescholarship_agreement_responseslog is currently the only record of it. - Anything outside a request — jobs, rake tasks, console, webhooks (Stripe). These are dropped twice over: the actor guard, and
Analytics::LifecycleBufferonly flushing inApplicationController'safter_action, so a buffered event outside a request is never written.
Recommendation
Close the request-shaped hole narrowly rather than removing the guard.
- Default a source for every actorless request — one line in
ApplicationController: setCurrent.sourcewhen there's no signed-in user, so any public flow (present or future) is covered without each controller having to remember. Named per controller where it matters, generic otherwise. - Opt non-request contexts in explicitly — jobs, webhooks, and rake tasks set their own
Current.source("stripe_webhook","job:x"), andLifecycleBufferneeds a flush path that doesn't depend on a controller. - Don't just delete the guard. Seeds, imports, and the test suite would start emitting events in volume, which is presumably why it's there.
Acceptance
- A logged-out recipient accepting a scholarship agreement produces an Ahoy event attributed to a named source.
- A model write inside a job produces an event (or is a documented, deliberate exclusion).
- Specs cover both, so the guard can't silently re-open the hole.
- Lenguaje dominante
- Ruby
- Estrellas
- 15
- Forks
- 28
- Merge medio
- 1 d 12 min
- PR fusionados (30 d)
- 262
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una 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 rubyforgood/awbw
-
blocked
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
rubyforgood/awbw#2824 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
rubyforgood/awbw#2822 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rubyforgood/awbw#2160 ·
Los mantenedores suelen responder en 1 día
-
Update callout faq defualt text when the new person subscription launchesPosiblemente ocupada @maebeale la tomó hace 77 días. Abiertoblocked
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rubyforgood/awbw#2095 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
rubyforgood/awbw#2088 ·
Los mantenedores suelen responder en 1 día
Todos los issues de rubyforgood/awbw
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
rmosolgo/graphql-ruby#5843 ·
Los mantenedores suelen responder en 1 día
-
Liens externes cassésAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 66/100
betagouv/conseillers-entreprises#4770 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
seek4science/seek#2762 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Freika/dawarich#3910 · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
rubyevents/rubyevents#2277 ·
Los mantenedores suelen responder en 1 día