Analytics: updateEventIfRequired mutates the shared ext.prebid.analytics node
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 71/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
🤖 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
- Linguagem predominante
- Java
- Estrelas
- 108
- Forks
- 258
- Merge médio
- 3d 20h
- PRs com merge (30d)
- 12
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de prebid/prebid-server-java
-
auto
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
prebid/prebid-server-java#4721 ·
Mantenedores costumam responder em até 2 dias
-
Port PR from PBS-Go: Beachfront: Fix for Off-by-one comparison against lengthTalvez já em andamento @osulzhenko assumiu há 2 dias. Abertaauto
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 53/100
prebid/prebid-server-java#4720 · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
auto
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
prebid/prebid-server-java#4719 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
prebid/prebid-server-java#4718 ·
Mantenedores costumam responder em até 2 dias
-
Analytics: cookie_sync and setuid events ignore analytics.global.adapters and account enabled flagAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
prebid/prebid-server-java#4717 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de prebid/prebid-server-java
Issues semelhantes
-
good first issue java test
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 2 dias
-
InterfaceMemberImpliedModifier: records and annotation types nested in interfaces are not checkedAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
checkstyle/checkstyle#23007 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
apache/logging-log4j2#4519 ·
Mantenedores costumam responder em até 3 dias
-
Vinyl Cache 9.1 is now LTSAbertabug
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 70/100
endoflife-date/endoflife.date#11679 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug finsim-cli low
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia