Analytics: updateEventIfRequired mutates the shared ext.prebid.analytics node
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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時間
- マージ済み PR(30日)
- 12
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
-
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時間 初心者へのやさしさ 68/100
apache/logging-log4j2#4519 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
endoflife-date/endoflife.date#11679 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug finsim-cli low
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信