Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Replace the Auditor write path with MemberActivityRecorder — one funnel for activity rows

Abierto
#2,944 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
72/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rails, ruby
Área
backend

Línea de trabajo

Start by reading MemberActivityRecorder and app/services/auditor.rb, then trace the two Auditor::Audit call sites in ContactPreferencesController and Admin::SponsorsController. Check Sponsor's activities helper and the listed direct activity reads before changing the write path. Done means one PublicActivity::Activity creation location, preserved sponsor-consent activity keys, reported recorder failures, and removal of app/services/auditor.rb.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

refactoring tech debt

Problem

MemberActivityRecorder describes itself as the "single funnel for member-activity rows" and is used by ~18 controllers and services. But writes to PublicActivity::Activity still happen through two different wrappers:

  1. MemberActivityRecorder.record(actor:, key:, trackable:, recipient:) — validates keys against a KEYS vocabulary, never raises (logs failures via Rails.logger.warn).
  2. Auditor::Audit (app/services/auditor.rb) — ad-hoc wrapper, passes parameters: (a changes hash or {note: ...}), used only by:
    • ContactPreferencesController#audit_contact_subscription
    • Admin::SponsorsController#audit_contact_subscription
    • Sponsor includes Auditor::Model for a read-only #activities helper

Both write the same table with the same columns. Two funnels means inconsistent key vocabularies, no key validation on the Auditor path, and duplicate machinery.

(Direct reads of PublicActivity::Activity — Admin::MembersController, Admin::Members::ActivityStrip, SubscriptionTombstoneBackfill — are fine as-is; only writes need one funnel.)

Proposed change

  • Extend MemberActivityRecorder to accept the one thing Auditor has that it lacks: parameters (the note/changes payload).
  • Re-point the two Auditor::Audit.new(...) call sites at MemberActivityRecorder.record, registering their sponsor.contact_subscribe / sponsor.contact_unsubscribe keys in KEYS.
  • Failure policy: keep the recorder's swallow-and-continue behaviour, but report failures with Rails.error.report instead of Rails.logger.warn so they reach Rollbar (same pattern as ApplicationJob). Raising by default was considered and rejected: recording is a side effect and must not turn a completed user action into a 500.
  • Move Sponsor#activities (the only useful part of Auditor::Model) to where it's used, and delete app/services/auditor.rb.

Acceptance

  • PublicActivity::Activity.create is called in exactly one place: MemberActivityRecorder.
  • Sponsor contact-consent changes still appear in the sponsor's activity trail with the same keys.
  • Recorder failures surface in Rollbar.
  • app/services/auditor.rb deleted.
Lenguaje dominante
Ruby
Estrellas
104
Forks
205
Merge medio
1 d 4 h
PR fusionados (30 d)
77

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codebar/planner

Todos los issues de codebar/planner

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.