Analytics: updateEventIfRequired mutates the shared ext.prebid.analytics node
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Read AnalyticsReporterDelegator.java, especially updateAuctionContext at the linked lines, and trace how prepareAnalytics handles reporters without an analytics entry. Reproduce the AMP or video case with two reporters and account module config, then check that each reporter receives its own analytics node and the original request remains unchanged.
由索引模型根據 Issue 內容生成。
描述
🤖 This issue was written by an AI agent (Claude Code) on behalf of @patmmccann.
What happens
updateEventIfRequired → updateAuctionContext merges the account's analytics.modules.<reporter> config into ext.prebid.analytics.<reporter> for each reporter, but it writes into the request's existing JsonNode objects instead of copies:
adapterNodeis the liveanalyticsNode.get(adapterName)when it exists, andadapterNode.set(...)adds the account fields to it.((ObjectNode) analyticsNode).set(adapterName, adapterNode)changes the sharedext.prebid.analyticsobject.
The new BidRequest/AuctionContext built afterwards still points to the same, now changed, node.
Which node is shared:
- AMP and video events: always the original request's node, because they aren't trimmed per reporter (see https://github.com/prebid/prebid-server-java/issues/4715).
- Auction events: the original node for any reporter that has no entry in
ext.prebid.analytics, becauseprepareAnalyticsreturnsnulland the originalextis kept (L324-L350). It is also the original node forlogAnalytics, which is exempt from trimming.
Reporters run one after another through vertx.runOnContext. So when a reporter that shares the node runs after another reporter's config was merged into it, it sees the earlier reporter's account-level module config under the earlier reporter's key.
Why it matters
Account-level analytics module config (e.g. per-publisher keys or scope IDs for a reporter) could end up visible to other reporters. Which reporters see it depends on reporter order. Changing the request in place from inside the analytics path is also fragile if anything else reads the request afterwards.
To reproduce
Two reporters enabled, e.g. pubstack and greenbids. Account config:
{ "analytics": { "modules": { "pubstack": { "key1": "a" }, "greenbids": { "key2": "b" } } } }
An AMP (via stored request) or video request with "ext": {"prebid": {"analytics": {"pubstack": {}, "greenbids": {}}}}: the reporter that runs second sees the other reporter's merged account fields in ext.prebid.analytics.
Expected behaviour
Each reporter gets its own copy of ext.prebid.analytics (ideally trimmed to its own entry), and the request object isn't changed.
Suggested fix
Work on analyticsNode.deepCopy() (and a copy of the adapter node) in updateAuctionContext, and build the new ExtRequestPrebid from that copy.
References
- Found while documenting PBS analytics events: https://github.com/prebid/prebid.github.io/pull/6997
🤖 Generated with Claude Code
- 主要語言
- Java
- 星號
- 108
- 分支
- 258
- 平均合併
- 3 天 20 小時
- 30 天內合併 PR
- 12
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
prebid/prebid-server-java 的其他 Issue
-
auto
難度 3/5 1-2 天 新手友好度 52/100
prebid/prebid-server-java#4721 ·
維護者通常 2 天內回覆
-
Port PR from PBS-Go: Beachfront: Fix for Off-by-one comparison against length可能已有人在做 @osulzhenko 於 2 天前認領。 未關閉auto
難度 2/5 1-3 小時 新手友好度 53/100
prebid/prebid-server-java#4720 · 已指派 1 人 ·
維護者通常 2 天內回覆
-
auto
難度 4/5 3-5 天 新手友好度 35/100
prebid/prebid-server-java#4719 ·
維護者通常 2 天內回覆
-
難度 4/5 3-5 天 新手友好度 52/100
prebid/prebid-server-java#4718 ·
維護者通常 2 天內回覆
-
Analytics: cookie_sync and setuid events ignore analytics.global.adapters and account enabled flag未關閉
難度 4/5 3-5 天 新手友好度 55/100
prebid/prebid-server-java#4717 ·
維護者通常 2 天內回覆
查看 prebid/prebid-server-java 的全部 Issue
相似的 Issue
-
documentation good first issue help wanted
難度 1/5 1 小時以內 新手友好度 78/100
2025sl93031-ShubhamSain/SustainRank-ESG-Intelligence-Platform#57 ·
維護者通常 1 天內回覆
-
good first issue java test
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 2 天內回覆
-
InterfaceMemberImpliedModifier: records and annotation types nested in interfaces are not checked未關閉
難度 2/5 1-3 小時 新手友好度 72/100
checkstyle/checkstyle#23007 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
-
難度 2/5 1-3 小時 新手友好度 70/100
apache/incubator-kie-issues#2427 ·