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

[CM-1090] Allow resolving idcookie #304

Merged
merged 7 commits into from
Jan 16, 2024
Merged

[CM-1090] Allow resolving idcookie #304

merged 7 commits into from
Jan 16, 2024

Conversation

mschuwalow
Copy link
Contributor

@mschuwalow mschuwalow commented Jan 10, 2024

CM-1090

Author Todo List:

  • Add/adjust tests (if applicable)
  • Build in CI passes
  • Latest master revision is merged into the branch
  • Self-Review
  • Set Ready For Review status

@3link 3link self-requested a review January 12, 2024 08:14
this.timeout
)
private buildUrl(params: [string, string][]): string {
return `${this.url}/${this.source}/${this.publisherId}${toParams(this.filterParams(params))}`
}

getUrl(additionalParams: Record<string, string | string[]>): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any idea why we expose the resolutionCallUrl in LiveConnect at all getUrl is used to compute resolutionCallUrl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea. As you say, it's just an alias for getUrl resolutionCallUrl: resolver.getUrl.bind(resolver),

Comment on lines +318 to +328
it('should resolve the idcookie when requested via additional attributes', (done) => {
const value = 'foo'
const identityResolver = new IdentityResolver({ resolvedIdCookie: value }, calls)
const successCallback = (responseAsJson) => {
expect(requestToComplete.url).to.eq('https://idx.liadm.com/idex/unknown/any')
expect(errors).to.be.empty()
expect(responseAsJson).to.be.eql({ idcookie: value })
done()
}
identityResolver.resolve(successCallback, () => {}, { resolve: ['idcookie'] })
requestToComplete.respond(200, { 'Content-Type': 'application/json' }, JSON.stringify({}))
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@3link 3link requested a review from a team January 12, 2024 08:58
CONFIGURATION_OPTIONS.md Show resolved Hide resolved
return state => {
let resolvedIdCookie: string | null

if (state.idCookie?.mode === 'provided' && state.idCookie?.strategy === 'cookie' && typeof state.idCookie?.name === 'string') {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can make 'generated', 'provided', 'cookie', 'localStorage' constants and use them, WDYT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really any benefit when using typescript. It is already typed as "provided" | "generated" and will complain if you try to compare it to any other string

src/pixel/fiddler.ts Outdated Show resolved Hide resolved
@mschuwalow mschuwalow requested a review from wi101 January 15, 2024 16:13
@mschuwalow mschuwalow merged commit 59a57cd into master Jan 16, 2024
4 of 5 checks passed
@mschuwalow mschuwalow deleted the cm-1090 branch January 16, 2024 12:45
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.

4 participants