Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Stamp a correlation id on Ahoy events so one save reads as one action

Đang mở
#2,356 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
ruby
Lĩnh vực
backend, database

Hướng nghiên cứu

Bắt đầu bằng cách đọc ApplicationController, Analytics::EventBuilder.lifecycle và promotion hook hiện có trong config/initializers/ahoy.rb để theo dõi cách các event được ghi và promote. Kiểm tra issue liên quan #2351 trước khi bắt đầu. Được xem là hoàn tất khi các event từ cùng một request dùng chung một id có thể truy vấn, còn các event từ những request riêng biệt thì không, và jobs cùng rake tasks nhận các id riêng của chúng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

🤖 From Claude:

One admin save that touches several records produces several unrelated events. ahoy_events has visit_id, but that's a session, not an action — there is no way to say "these five changes were one save."

A timeline that wants to render "Mae updated this registration" instead of five separate rows needs that grouping, and so does any "undo this action" or "what did that save actually do" view.

Why now rather than later

The column is cheap. The data is not backfillable — every event written before the id exists is permanently ungroupable. This is the same argument that made the capture fixes in #2245 urgent: nothing is lost by shipping the reader later, everything is lost by shipping the writer later.

Sketch

  • A per-request uuid (ApplicationController sets it alongside Current.user), stamped into properties by Analytics::EventBuilder.lifecycle and promoted to a column by the same before_validation hook in config/initializers/ahoy.rb that already promotes resource_type / resource_id.
  • Index it, so grouping is a lookup rather than a scan.
  • Jobs and rake tasks get their own id per run, which also gives "what did that job change" for free.

Acceptance

  • Two records changed in one request share an id; the same records changed in two requests don't.
  • The id is queryable as a column, not only inside the JSON payload.

Related: #2351 (many writes produce no event at all — worth fixing first, since an id on nothing is still nothing).

Ngôn ngữ chính
Ruby
Star
15
Fork
28
Merge trung bình
1 ngày 12 phút
Pull request đã merge (30 ngày)
262

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rubyforgood/awbw

Tất cả issue của rubyforgood/awbw

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.