Replace the Auditor write path with MemberActivityRecorder — one funnel for activity rows
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
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
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:
MemberActivityRecorder.record(actor:, key:, trackable:, recipient:)— validates keys against aKEYSvocabulary, never raises (logs failures viaRails.logger.warn).Auditor::Audit(app/services/auditor.rb) — ad-hoc wrapper, passesparameters:(a changes hash or{note: ...}), used only by:ContactPreferencesController#audit_contact_subscriptionAdmin::SponsorsController#audit_contact_subscriptionSponsorincludesAuditor::Modelfor a read-only#activitieshelper
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
MemberActivityRecorderto accept the one thingAuditorhas that it lacks:parameters(the note/changes payload). - Re-point the two
Auditor::Audit.new(...)call sites atMemberActivityRecorder.record, registering theirsponsor.contact_subscribe/sponsor.contact_unsubscribekeys inKEYS. - Failure policy: keep the recorder's swallow-and-continue behaviour, but report failures with
Rails.error.reportinstead ofRails.logger.warnso they reach Rollbar (same pattern asApplicationJob). 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 ofAuditor::Model) to where it's used, and deleteapp/services/auditor.rb.
Acceptance
PublicActivity::Activity.createis 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.rbdeleted.
- Lenguaje dominante
- Ruby
- Estrellas
- 104
- Forks
- 205
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 77
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
-
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 56/100
Los mantenedores suelen responder en 1 día
-
InvitationManager silently no-ops on non-invitable events/workshops while controllers flash successAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
refactoring tech debt
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de codebar/planner
Issues similares
-
security
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
IBM/aspera-cli#265 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 3 días
-
[Bug]: QR Code do Evolution Go não aparece no CRM com Evolution Go 0.7.2 (campos em minúsculo)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
evolution-foundation/evo-ai-crm-community#423 ·
Los mantenedores suelen responder en 1 día