Skip to content

Conversation

mmustafa-tse
Copy link
Contributor

Summary

  • Per this google doc code block, we should always send the default consent state as is and then listen and send an update consent state payload instead of merging the updated consent state as the new default, this issue was brought to our attention by a customer

Testing Plan

  • [Y] Was this tested locally? If not, explain why.
  • Unit tested and E2E tested (refer to this doc here with sample screenshot and new workflow)

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

src/common.js Outdated
// so we shouldn't send an update.
if (this.consentPayloadAsString && this.consentMappings) {

if (!this.isEmpty(consentState)) {
Copy link
Contributor Author

@mmustafa-tse mmustafa-tse Sep 10, 2024

Choose a reason for hiding this comment

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

I can probably move this to the if statement at 150 to avoid unnecessary nested if statements

common.consentHandler.generateConsentStatePayloadFromMappings(
updatedConsentState,
common.consentMappings
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also this can become one var and then comma separated instead of having 3 vars for each, let me know if this is preferred

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved it back to 3 vars instead of comma separated per meeting with @alexs-mparticle

updatedDefaultConsentPayload
);

common.sendConsent('default', updatedDefaultConsentPayload);
Copy link
Contributor Author

@mmustafa-tse mmustafa-tse Sep 10, 2024

Choose a reason for hiding this comment

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

I can probably make a function in common for lines 82-86 and 88-92 and call it here instead of having the same repeated lines of code since they're doing the same actions just with two different variables

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

Successfully merging this pull request may close these issues.

3 participants