You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace the Auditor write path with MemberActivityRecorder — one funnel for activity rows #2944
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 a KEYS vocabulary, never raises (logs failures via Rails.logger.warn).
Auditor::Audit (app/services/auditor.rb) — ad-hoc wrapper, passes parameters: (a changes hash or {note: ...}), used only by:
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.
Activity
davidmillen50 commentedon Oct 30, 2026
WIP #3068