Analytics: updateEventIfRequired mutates the shared ext.prebid.analytics node
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 71/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🤖 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
- Ngôn ngữ chính
- Java
- Star
- 108
- Fork
- 258
- Merge trung bình
- 3 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
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.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không 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 prebid/prebid-server-java
-
auto
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
prebid/prebid-server-java#4721 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Port PR from PBS-Go: Beachfront: Fix for Off-by-one comparison against lengthCó thể đã có người làm @osulzhenko đã nhận 2 ngày trước. Đang mởauto
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 53/100
prebid/prebid-server-java#4720 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
auto
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
prebid/prebid-server-java#4719 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
prebid/prebid-server-java#4718 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Analytics: cookie_sync and setuid events ignore analytics.global.adapters and account enabled flagĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
prebid/prebid-server-java#4717 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của prebid/prebid-server-java
Issue tương tự
-
good first issue java test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
-
InterfaceMemberImpliedModifier: records and annotation types nested in interfaces are not checkedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
checkstyle/checkstyle#23007 ·
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
apache/logging-log4j2#4519 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Vinyl Cache 9.1 is now LTSĐang mởbug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
endoflife-date/endoflife.date#11679 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug finsim-cli low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày