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

Prebid Core : fix issue of mergeConfig #8791

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

pm-azhar-mulla
Copy link
Contributor

Type of change

  • Bugfix

Description of change

We have observed following behaviour during our testing.
When mergeConfig is used after setConfig, all the properties which have object as value in the config are merged or get the latest value but the properties which are non-object, are not merged or does not get the latest value.
e.g:

pbjs.setConfig({
  testProp: 2000,
  testObj: {
     a1: 1
  }
});

pbjs.mergeConfig({
  testProp: 3000,
  testObj: {
     a1: 2,
     a2: 3
  }
});

After the above statements execution, the value of config object becomes

testProp: 2000,
testObj: {
  a1: 2,
  a2: 3
}

Here the value of testObj is merged but testProp isn't.
The reason being, when we call mergeConfig, it calls mergeDeep internally on the conflicting properties.
Since mergeDeep only works for object, we get above behaviour.

Solution:
Instead of using a mergeDeep on conflicting properties, we have used it on complete object.

@ChrisHuie ChrisHuie self-requested a review August 10, 2022 14:59
@ChrisHuie ChrisHuie self-assigned this Aug 10, 2022
@ChrisHuie ChrisHuie merged commit 2227454 into prebid:master Aug 10, 2022
@patmmccann
Copy link
Collaborator

@pm-azhar-mulla @pm-harshad-mane @mike-chowla we have witnessed many properties dropping from the pubmatic endpoint call in prebid 7.8 with the jw boost rtd adapter installed. Is this the fix?

JacobKlein26 pushed a commit to nextmillenniummedia/Prebid.js that referenced this pull request Feb 9, 2023
Co-authored-by: pm-azhar-mulla <azhar@L1119.local>
jorgeluisrocha pushed a commit to jwplayer/Prebid.js that referenced this pull request May 23, 2023
Co-authored-by: pm-azhar-mulla <azhar@L1119.local>
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.

4 participants