Replace the Auditor write path with MemberActivityRecorder — one funnel for activity rows
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 72/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Ruby
- Sterne
- 106
- Forks
- 208
- Ø Merge
- 19 Std. 31 Min.
- Gemergte PRs (30 T.)
- 84
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus codebar/planner
-
DashboardQuery eager-loads workshop_host with :sponsors in one join (same host-loss trap as #2975)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Dual Invitiation issueEvtl. vergeben @mroderick hat das vor 5 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 42/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
codebar/planner#3008 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codebar/planner
Ähnliche Issues
-
🐛 bug 🧑💼 conseillers
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
betagouv/conseillers-entreprises#4768 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`github-events` aborts the repository scan when a closed pull's API payload has a null `head`Evtl. vergeben @renyamamoto2026-cmyk hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
zerocracy/judges-action#2823 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`spoom srb bump DIRECTORY` bumps files outside DIRECTORYEvtl. vergeben @RaphaelFakhri hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
aws/aws-sdk-ruby#3460 ·
Maintainer antworten meist innerhalb von 1 Tag