-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
updated userid module to stop caching the entire consent object #5641
updated userid module to stop caching the entire consent object #5641
Conversation
…ather just a hash of it, since all we need it for is comparison purposes.
the CI fail seems unrelated to this PR, it's from of |
src/utils.js
Outdated
// IE doesn't support imul | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul#Polyfill | ||
if (!Math.imul) { | ||
Math.imul = function(opA, opB) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that we were not allowing polyfills.
I could be wrong but I thought I read / heard that somewhere...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I left a comment regarding polyfills.
I thought I heard or read somewhere that we were not going to allow them...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright sweet looks good, thanks Scott
* @param seed (optional) | ||
* @returns {string} | ||
*/ | ||
export function simpleHash(str, seed = 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any chancce you can call this cyrb53Hash or something describing what it is; the source you chose has many hashes.
…id#5641) * updated userid module to stop caching the entire consent object but rather just a hash of it, since all we need it for is comparison purposes. * IE doesn't support Math.imul, so providing a polyfill for it when necessary * use `===` to compare consent values; convert hashes to a string when returning them * add test for string response and fix @returns doc * don't use polyfills!
…ct (prebid#5641)" This reverts commit bd892d8.
Type of change
Description of change
after the discussion at the end of #5451, we agreed that we should store just a hash of the consent object rather than the entire object, since all we need it for is comparison purposes between the previous consent and the current consent for the user.
Other information
#5451 (comment)