Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

setBidderConfig is merging values into global config

Open bozghiyy opened this issue 4 years ago • 0 comments

Type of issue

bug

Description

When using setBidderConfig to set some custom config for a specific bidder, the values get merged into the global config. I've noticed it when trying to setup a custom schain for a specific bidder, but I think this applies to other config properties. (didn't tested but I assume First Party Data or other specific bidder configurations)

Seems to be in connection with bid requests. When the bid requests are made for the bidder you specified the custom config with setBidderConfig, then it gets merged into global config. (and, of course, the sequential requests are made with an schain with merged nodes).

Steps to reproduce

  • pbjs.setConfig to set global schain
  • pbjs.setBidderConfig to set schain for a specific bidder
  • this only happens when bids are requested for the specific bidder (pbjs.requestBids)
  • verify schain config if it has only the global node (pbjs.getConfig('schain'))

Test page

Load the following pages and look for pbjs.getConfig('schain') console.log.

Issue on Prebid 6.8.0: http://stage.adops.ro/prebid_mergedeep_issue/6.8.0.html Working correctly on Prebid 6.4.0: http://stage.adops.ro/prebid_mergedeep_issue/6.4.0.html

Expected results

Global config should have just one schain node image

Actual results

Global config has two schain nodes: image

Platform details

Prebid 6.5.0 and higher

Other information

I think it has to do with the modification of mergeDeep here https://github.com/prebid/Prebid.js/commit/31cc4b42f92d187022e63d183da3c2a385d96228#diff-3274f1a37032fb0ae4e2823def0007c634e869ae0dfc304ff6a12c36513c3a52L1275-R1286

bozghiyy avatar Jan 21 '22 16:01 bozghiyy