Replace the Auditor write path with MemberActivityRecorder — one funnel for activity rows
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Ruby
- Star
- 104
- Fork
- 205
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 77
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codebar/planner
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
Maintainer thường phản hồi trong vòng 1 ngày
-
InvitationManager silently no-ops on non-invitable events/workshops while controllers flash successĐang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
refactoring tech debt
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codebar/planner
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 3 ngày
-
L: docker L: elm L: github:actions L: helm L: ruby:bundler
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
dependabot/dependabot-core#16425 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày