Analytics: updateEventIfRequired mutates the shared ext.prebid.analytics node
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 71/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🤖 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
- Vorherrschende Sprache
- Java
- Sterne
- 108
- Forks
- 258
- Ø Merge
- 3 T. 20 Std.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus prebid/prebid-server-java
-
auto
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
prebid/prebid-server-java#4721 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Port PR from PBS-Go: Beachfront: Fix for Off-by-one comparison against lengthEvtl. vergeben @osulzhenko hat das vor 2 Tagen übernommen. Offenauto
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 53/100
prebid/prebid-server-java#4720 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 2 Tagen
-
auto
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
prebid/prebid-server-java#4719 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
prebid/prebid-server-java#4718 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Analytics: cookie_sync and setuid events ignore analytics.global.adapters and account enabled flagOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
prebid/prebid-server-java#4717 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in prebid/prebid-server-java
Ähnliche Issues
-
good first issue java test
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 2 Tagen
-
InterfaceMemberImpliedModifier: records and annotation types nested in interfaces are not checkedOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
checkstyle/checkstyle#23007 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
apache/logging-log4j2#4519 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
bug
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 70/100
endoflife-date/endoflife.date#11679 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug finsim-cli low
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag