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

Kargo Bidder tries to define _sessionId in frozen spec object. #3991

Closed
betancourtl opened this issue Jul 11, 2019 · 2 comments
Closed

Kargo Bidder tries to define _sessionId in frozen spec object. #3991

betancourtl opened this issue Jul 11, 2019 · 2 comments

Comments

@betancourtl
Copy link
Contributor

Type of issue

Bug

Description

Looks like kargoBidAdapter is crashing when fetching bids because it tries to update the spec object. The spec object gets frozen by the registerBidder() fn.

Screen Shot 2019-07-11 at 5 08 27 PM

I tracked that fn call in the kargoBidAdapter and it lead me here:

_getSessionId() {
if (!spec._sessionId) {
spec._sessionId = spec._generateRandomUuid();
}
return spec._sessionId;
},

the spec object then gets passed here where it gets frozen.

return Object.assign(new Adapter(spec.code), {
getSpec: function() {
return Object.freeze(spec);
},
registerSyncs,

From MDN

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze

A frozen object can no longer be changed; freezing an object prevents new properties from being added to it, existing properties from being removed, prevents changing the enumerability, configurability, or writability of existing properties, and prevents the values of existing properties from being changed. In addition, freezing an object also prevents its prototype from being changed. freeze() returns the same object that was passed in.

Steps to reproduce

Try to request bids using kargoBidAdapter on a page and use the debug query param
pbjs_debug=true

Expected results

Expect the bidder not to crash.

Actual results

bidder crashes.

@betancourtl
Copy link
Contributor Author

Looks like it was fixed by #3998

@bretg
Copy link
Collaborator

bretg commented Jul 28, 2019

Yup fixed with #3998

@bretg bretg closed this as completed Jul 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants