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

add user syncing for kargo #3099

Merged
merged 1 commit into from
Sep 20, 2018
Merged

add user syncing for kargo #3099

merged 1 commit into from
Sep 20, 2018

Conversation

samuelhorwitz
Copy link
Contributor

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

Add user syncing to Kargo

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @samuelhorwitz

Please take a look at the feedback below when you have the chance. Thanks!

const seed = spec._generateRandomUuid();
const clientId = spec._getClientId();
if (syncOptions.iframeEnabled && seed && clientId) {
for (let i = 0; i < SYNC_COUNT; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm the intended logic here - this setup will always generate 5 sync requests that are largely the same minus the idx param which gets incremented by 1 for each subsequent sync request. Is that the expected behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we want to attempt 5 syncs (barring a cap set by the configuration) and we want our server to be able to choose what to sync, potentially randomly, using a stateless system that gets passed an instance ID/seed and an incrementer.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying.

uid = {};
shouldSimulateOutdatedBrowser = false;

sandbox.stub(crypto, 'getRandomValues').callsFake(function(buf) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently returns an undefined error on the crypto object when the unit tests run in IE11 (see the circleci failed job for details). Can you please take a look and fix the issue?

const clientId = '74c81cbb-7d07-46d9-be9b-68ccb291c949';
var shouldSimulateOutdatedBrowser,
uid,
isActuallyOutdatedBrowser;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some extra spaces before these variables that are causing some lint errors when I run gulp lint. See below for a copy of the error message:

/Users/jsnellbaker/git/Prebid.js/test/spec/modules/kargoBidAdapter_spec.js
  394:1  error  Expected indentation of 6 spaces but found 8  indent
  395:1  error  Expected indentation of 6 spaces but found 8  indent

Can you make this fix?

Normally linting errors would be caught by circleci. So going forward, you may want to look into updating/rebasing your fork with the latest version of master so we can catch these automatically when you submit a PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch, I'll fix and rebase as well.

@jsnellbaker
Copy link
Collaborator

@samuelhorwitz Thanks for making the additional changes; LGTM

@jsnellbaker jsnellbaker merged commit 84e1cbf into prebid:master Sep 20, 2018
ptomasroos pushed a commit to happypancake/Prebid.js that referenced this pull request Sep 25, 2018
pedrolopezmrf pushed a commit to Marfeel/Prebid.js that referenced this pull request Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants