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

Further expand the consent info storage limit to 1200 #28917

Merged
merged 1 commit into from
Jun 17, 2020

Conversation

zhouyx
Copy link
Contributor

@zhouyx zhouyx commented Jun 16, 2020

Closes #28668
An example stored value is

{"amp-consent:example-key":{"s":1,"r":"example-consent-string","m":{"cst":1,"ac":"example-additional-consent"}}}

Copy link
Contributor

@micajuine-ho micajuine-ho left a comment

Choose a reason for hiding this comment

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

Thanks for these changes from enforcing string size to whole storage size! Do you think realistically there are any pages that will be over the limit with their current storage size?

Comment on lines +377 to +379
dict({
[this.storageKey_]: value,
})
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious, why dict, instead of object?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't make much of a difference here given that value is calculated internally.
But dict() returned value makes sure that JSON.Stringify() won't error out due to functions or any unparsed stuff in Object.

I used dict() also because that how we store values to localStorage. Kinda want to keep it the same.

this.values_[name] = dict({
'v': value,
't': Date.now(),
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation!

@zhouyx zhouyx merged commit e667e50 into ampproject:master Jun 17, 2020
@zhouyx zhouyx deleted the size-limit branch June 17, 2020 19:05
@olivervw
Copy link

Sorry to report this, but we are currently experiencing a '[CONSENT-STATE-MANAGER] Cannot store consent information which length exceeds 1200. Previous stored consentInfo will be cleared' error with our cmp solution on AMP. Are there any plans to extend the localStorage usage for amp-consent to allow more than 1200 characters (1600 b64 encoded) in a near future ?

@micajuine-ho
Copy link
Contributor

Hi @olivervw , please see this comment regarding consent information size.

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.

Expand consent Information size limit to 1200
5 participants