Stamp a correlation id on Ahoy events so one save reads as one action
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先阅读 ApplicationController、Analytics::EventBuilder.lifecycle 以及 config/initializers/ahoy.rb 中现有的 promotion hook,以追踪事件的写入和 promote 过程。开始前检查相关的 #2351 issue。完成的标准是:同一请求中的事件共享一个可查询的 id,而不同请求中的事件不共享,并且 jobs 和 rake tasks 各自获得独立的 id。
由索引模型根据 Issue 内容生成。
描述
🤖 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 (
ApplicationControllersets it alongsideCurrent.user), stamped intopropertiesbyAnalytics::EventBuilder.lifecycleand promoted to a column by the samebefore_validationhook inconfig/initializers/ahoy.rbthat already promotesresource_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).
- 主要语言
- Ruby
- 星标
- 15
- 派生
- 28
- 平均合并
- 1 天 12 分钟
- 30 天内合并 PR
- 262
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rubyforgood/awbw 的其他 Issue
-
blocked
难度 2/5 1-3 小时 新手友好度 68/100
rubyforgood/awbw#2824 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
rubyforgood/awbw#2822 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
rubyforgood/awbw#2160 ·
维护者通常 1 天内回复
-
Update callout faq defualt text when the new person subscription launches可能已有人在做 @maebeale 于 80 天前认领。 未关闭blocked
难度 2/5 1-3 小时 新手友好度 72/100
rubyforgood/awbw#2095 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
rubyforgood/awbw#2088 ·
维护者通常 1 天内回复
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
alphagov/tech-docs-gem#580 ·
维护者通常 1 天内回复
-
Onboarding form: instructor radio never pre-selected "Yes" (permission vs permissions typo)可能已有人在做 @ThakuraAnki 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 72/100
WikiEducationFoundation/WikiEduDashboard#7235 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
zerocracy/judges-action#3021 ·
维护者通常 2 天内回复
-
Missing de translation: components/common/CommunitySolution.tsx:communitySolution.passesLatestTests未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 63/100
hitobito/hitobito_bdp#58 ·