scm-spain / boros-CMP

GDPR CMP (Consent Managment Provider) implementation
MIT License
5 stars 1 forks source link

cmpVersion is not set correctly #67

Closed madmax closed 5 years ago

madmax commented 5 years ago

If we call

__cmp('setVendorConsents', vendorConsents: [], purposeConsents: [])

Consest string will have version = 0

Problem is with lib/cmp/infrastructure/container/local/LocalConsentContainer.js

  function LocalConsentContainer(_temp) {
    var _ref = _temp === void 0 ? {} : _temp,
        config = _ref.config,
        window = _ref.window,
        _ref$cmpVersion = _ref.cmpVersion,
        cmpVersion = _ref$cmpVersion === void 0 ? "1" : _ref$cmpVersion,
        eager = _ref.eager;
    return _BaseConsentContainer.call(this, {
      config: config,
      cmpVersion: cmpVersion,
      window: window
    }) || this;
  }

I don't see option to pass cmpVersion and also cmpVersion should be Int only then it is encoded corectly when using getConsentString

This is code from npm package. For source version it works ok if I set window.CMP_VERSION = 1

alextremp commented 5 years ago

Hey @madmax thanks for the appreciation :) We've checked that and it's true, storing a consent lets the cmpVersion to zero.

Our intention is to have a cmpVersion that fits the major version of the project, because it's actually implementing the IAB's 1.1 standard (so 1 should be the stored value), and during the next months when the IAB's standard will be upgraded to its version 2, we'll upgrade the major version to 2, so the cmpVersion will be 2 for that releases.

We'll fix this soon, thanks!

alextremp commented 5 years ago

@madmax The issue has been fixed, you can check the closed PR #68

Version 1.3.3 has been pushed to NPM.

Regards

CC @scm-spain/one-punch-team