Skip to content

RTD: isolate submodules from each other's callbacks and exceptions - #15479

Open
florianerl wants to merge 1 commit into
prebid:masterfrom
florianerl:rtd-resilient-submodule-hooks
Open

RTD: isolate submodules from each other's callbacks and exceptions#15479
florianerl wants to merge 1 commit into
prebid:masterfrom
florianerl:rtd-resilient-submodule-hooks

Conversation

@florianerl

Copy link
Copy Markdown
Contributor

Type of change

  • Bugfix

  • Feature

  • New bidder adapter

  • Updated bidder adapter

  • Code style update (formatting, local variables)

  • Refactoring (no functional changes, no api changes)

  • Build related changes

  • CI related changes

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • Other

Description of change

Every call into provider code ran unguarded, so a provider that threw in init, getBidRequestData or getTargetingData took down every provider behind it in the loop. getTargetingData is also wired in as the AUCTION_END preprocess, outside the guard around the event handlers, so a throw there cost those providers their onAuctionEndEvent too. All three are now wrapped the way onDataDeletionRequest already was.

Waiting is tracked by submodule identity rather than by a bare counter, so a provider that invokes its own callback twice can only clear its own slot instead of releasing the auction on another provider's behalf. That is also what lets the getBidRequestData catch drop a provider that threw: it will never call back, and the auction should not wait out auctionDelay for it.

Other information

Every call into provider code ran unguarded, so a provider that threw in init,
getBidRequestData or getTargetingData took down every provider behind it in the
loop. getTargetingData is also wired in as the AUCTION_END preprocess, outside
the guard around the event handlers, so a throw there cost those providers their
onAuctionEndEvent too. All three are now wrapped the way onDataDeletionRequest
already was.

Waiting is tracked by submodule identity rather than by a bare counter, so a
provider that invokes its own callback twice can only clear its own slot instead
of releasing the auction on another provider's behalf. That is also what lets the
getBidRequestData catch drop a provider that threw: it will never call back, and
the auction should not wait out auctionDelay for it.
@github-actions

Copy link
Copy Markdown

This PR introduces changes that may not work on all browsers. According to Babel, the following polyfills may be needed, and they are not automatically included:

  • Changes to modules/rtdModule/index.ts may need:
    • es.set.difference.v2
    • es.set.intersection.v2
    • es.set.is-disjoint-from.v2
    • es.set.is-subset-of.v2
    • es.set.is-superset-of.v2
    • es.set.symmetric-difference.v2
    • es.set.union.v2
    • esnext.set.difference.v2
    • esnext.set.intersection.v2
    • esnext.set.is-disjoint-from.v2
    • esnext.set.is-subset-of.v2
    • esnext.set.is-superset-of.v2
    • esnext.set.symmetric-difference.v2
    • esnext.set.union.v2

The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers.

@barecheck

barecheck Bot commented Aug 11, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 91.17%

Your code coverage diff: 0.01% ▴

Uncovered files and lines
FileLines
modules/rtdModule/index.ts118-119, 201, 219, 238-239, 244-245, 303

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.

1 participant