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

PAIR: Support for Generic TechLab Version #12146 #12599

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

therevoltingx
Copy link

@therevoltingx therevoltingx commented Dec 19, 2024

Documentation PR

prebid/prebid.github.io#5785

Clean Room Configuration

{
    userSync: {
      userIds: [{
        name: 'openPairId',
        params: {
          liveramp: {
            storageKey: '_lr_pairId'
          },
          habu: {
            storageKey: '_habu_pairId'
          }
       },
    }]
  }
}

Bid Request

{
  "ext": {
    "eids": [
      "source": "pair-protocol.com",
      "uids": [
        {
          "id": "0x1234", // using clean room A
          "atype": 3
        },
        {
          "id": "0x456", // using clean room B
          "atype": 3
        }
      ]
    ]
  }
}

return undefined;
}

return {'id': ids};
Copy link
Collaborator

@dgirardi dgirardi Dec 19, 2024

Choose a reason for hiding this comment

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

I think this requires some more logic to be converted into an EID - the userId module expects a string either from decode, or from eids.openPairId.getValue(id) eids.pairId.getValue(id) (because that's what referenced in decode - see other comment below)

From my testing (putting some random data in local storage), this does not generate any EID.

Copy link
Author

Choose a reason for hiding this comment

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

Seems that other modules return a hash in this format, including the original pairId and a few other examples:

return {'id': ids};

return {id: res};

return {id: newId, callback: getIdCallback(newId, pixelUrl)};
return {id: localValue};

I think your test was failing because I was not properly exporting the correct module. Do you mind testing again?

Copy link
Collaborator

@dgirardi dgirardi left a comment

Choose a reason for hiding this comment

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

I also recommend merging or rebasing with master, there's been quite a few changes to userId since this PR's parent.

* @returns {{pairId:string} | undefined }
*/
decode(value) {
return value && Array.isArray(value) ? {'pairId': value} : undefined
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be openPairId - if it's meant to be distinct from the other module - or if they're meant to be mutually exclusive (clashes are not a problem), the EID configuration in this should also use pairId.

@therevoltingx therevoltingx force-pushed the feature/adds-generic-pair branch from 3ff3e51 to 73e6c68 Compare December 23, 2024 09:42
@therevoltingx
Copy link
Author

@dgirardi I've gone ahead and rebased and addressed your comments. Please review again.

@patmmccann
Copy link
Collaborator

@therevoltingx your unit tests are failing; this isnt yet ready for review

@therevoltingx
Copy link
Author

@patmmccann my unit tests are passing on my end:

gulp test --modules=openPairIdSystem --file ./test/spec/modules/pairIdSystem_spec.js

What is failing for you?

@therevoltingx
Copy link
Author

gulp test seems to fail. do i need to add the submodule manually somewhere, seems to be a problem with loading the submodule within the spec

@patmmccann
Copy link
Collaborator

patmmccann commented Dec 26, 2024

If you click details next to the red x below, it has details on the failed tests

@patmmccann
Copy link
Collaborator

gulp test seems to fail. do i need to add the submodule manually somewhere, seems to be a problem with loading the submodule within the spec

Submodules.json

@therevoltingx
Copy link
Author

@patmmccann ok i have rebased with latest master and also tests are passing now!

@therevoltingx therevoltingx force-pushed the feature/adds-generic-pair branch from ad7bd83 to c5f58b9 Compare December 29, 2024 08:25
@therevoltingx therevoltingx force-pushed the feature/adds-generic-pair branch from c5f58b9 to 6a6f7c1 Compare December 29, 2024 08:29
@patmmccann patmmccann requested a review from dgirardi December 30, 2024 19:54
@patmmccann
Copy link
Collaborator

can you add changes to .submodules.json?

import { storage, openPairIdSubmodule } from 'modules/openPairIdSystem.js';
import * as utils from 'src/utils.js';

describe('openPairId', function () {
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 currently no tests on the eid being formed

Copy link
Collaborator

@patmmccann patmmccann left a comment

Choose a reason for hiding this comment

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

please add coverage on the eid you expect getting formed

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.

3 participants