Skip to content

Core: Resetting gpt targeting on bid won - #15398

Open
mkomorski wants to merge 4 commits into
masterfrom
mkomorski/bid-won-gpt-targeting
Open

Core: Resetting gpt targeting on bid won#15398
mkomorski wants to merge 4 commits into
masterfrom
mkomorski/bid-won-gpt-targeting

Conversation

@mkomorski

Copy link
Copy Markdown
Collaborator

Attaches presetGPTTargeting to BID_WON event

Type of change

  • Feature

Description of change

Closes #14943

Other information

@github-actions

Copy link
Copy Markdown

This PR includes an adapter whose code does not match its file name. Bid adapter modules should be named <bidderCode>BidAdapter, userId <userIdCode>IdSystem, RTD <rtdCode>RtdProvider, and analytics <analyticsCode>AnalyticsAdapter.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8ade8add9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/targeting.ts
@mkomorski mkomorski changed the title Core: Reseting gpt targeting on bid won Core: Resetting gpt targeting on bid won Jul 28, 2026
@barecheck

barecheck Bot commented Jul 28, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 96.67%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
src/targeting.ts107, 267, 411, 435-436
test/spec/unit/core/targeting_spec.js326, 1120, 1215, 1243, 1396-1397, 1743-1746

@patmmccann

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 309ff9bc69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/targeting.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 309ff9bc69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/targeting.ts Outdated
@mkomorski
mkomorski requested a review from patmmccann August 4, 2026 13:33
@patmmccann
patmmccann requested a review from dgirardi August 4, 2026 14:56
@patmmccann

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d181822a0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/targeting.ts
Comment on lines +451 to +452
events.on(EVENTS.AUCTION_END, ({ auctionId }) => {
unlockGptSlotsForAuction(auctionId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the GPT lock past auctionEnd

Fresh evidence in this revision is that the new AUCTION_END handler deletes the only guard, but src/auction.ts emits AUCTION_END before the bids-back callback where publishers normally call setTargetingForGPTAsync(). In that timing, a delayed BID_WON from an older auction that fires after auction B ends but after B's targeting is installed (or before the GPT refresh) sees no lock and runs presetGPTTargeting([adUnitCode]), clearing B's valid hb_* keys; keep the guard tied to the auction/targeting that is currently installed rather than removing it at AUCTION_END.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clear targeting at render time or bidwon

2 participants