Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: race condition with requestManager for tam & prebid bids #127

Merged
merged 3 commits into from
May 5, 2023

Conversation

caffeinated-pixels
Copy link
Contributor

Description

This fixes an issue when using both Prebid and Amazon TAM (APS) with React Advertising.

When multiple AdvertisingSlots call the activate function at the same time to request a new ad, they all use the same requestManager object to keep track of whether the Prebid and APS bids have returned. Because the requestManager values are used as conditional to control when an ad gets refreshed, this creates a race condition between the different ad units. The first ad unit to get both bids back gets refreshed/rerendered, the others don't.

The fix was to give every new ad request it's own requestManager object, instead of sharing a global object.

@caffeinated-pixels caffeinated-pixels merged commit 751bf77 into master May 5, 2023
1 check passed
@caffeinated-pixels caffeinated-pixels deleted the fix-tam-prebid-request-manager branch May 5, 2023 13:23
thedaviddias pushed a commit that referenced this pull request May 5, 2023
## [4.2.6](v4.2.5...v4.2.6) (2023-05-05)

### Bug Fixes

* race condition with requestManager for tam & prebid bids ([#127](#127)) ([751bf77](751bf77))
@thedaviddias
Copy link
Member

🎉 This PR is included in version 4.2.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

None yet

2 participants