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

storage.session quota enforcement #35629

Merged
merged 11 commits into from
Oct 1, 2024

Conversation

rebloor
Copy link
Contributor

@rebloor rebloor commented Aug 29, 2024

Description

Provides a release note for the enforcement of the session.storage quota in Firefox Nightly 131. Addresses the documentation requirements of Bug 1908925 storage.session quota is not enforced.

@rebloor rebloor added the Content:WebExt WebExtensions docs label Aug 29, 2024
@rebloor rebloor requested a review from dotproto August 29, 2024 00:21
@rebloor rebloor self-assigned this Aug 29, 2024
@rebloor rebloor requested a review from a team as a code owner August 29, 2024 00:21
@rebloor rebloor requested review from dipikabh and removed request for a team August 29, 2024 00:21
@github-actions github-actions bot added Content:Firefox Content in the Mozilla/Firefox subtree size/xs [PR only] 0-5 LoC changed and removed Content:WebExt WebExtensions docs labels Aug 29, 2024
Copy link
Contributor

github-actions bot commented Aug 29, 2024

@Rob--W Rob--W requested review from zombie and removed request for dipikabh August 29, 2024 07:10
Copy link
Member

@zombie zombie left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

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

The bug did not only introduce enforcement of the quota, but also support for the storage.session.getBytesInUse method and the storage.session.QUOTA_BYTES constant.

Could you update the docs and BCD?

files/en-us/mozilla/firefox/releases/131/index.md Outdated Show resolved Hide resolved
@rebloor rebloor requested a review from a team as a code owner September 2, 2024 09:00
@github-actions github-actions bot added Content:WebExt WebExtensions docs size/m [PR only] 51-500 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Sep 2, 2024
@rebloor rebloor changed the title storage.session quota enforcement release note storage.session quota enforcement Sep 2, 2024
@rebloor rebloor requested a review from Rob--W September 2, 2024 09:02

{{AddonSidebar}}

The maximum amount of data (in bytes) that can be stored in session storage. The amount of data in session storage is the sum of the size of every value (as measured by the StructuredCloneHolder) plus the sum of every key's length.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The maximum amount of data (in bytes) that can be stored in session storage. The amount of data in session storage is the sum of the size of every value (as measured by the StructuredCloneHolder) plus the sum of every key's length.
The maximum amount of data (in bytes) that can be stored in session storage.

StructuredCloneHolder is an internal inplementation detail. Let's drop it.

May make sense to refer to getBytesInUse to query hoe much quota is used.


{{Compat}}

<!--
Copy link
Member

Choose a reason for hiding this comment

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

Let's drop this whole section.

@@ -23,16 +24,14 @@ let gettingSpace = browser.storage.<storageType>.getBytesInUse(
)
```

`<storageType>` can only be {{WebExtAPIRef("storage.sync")}}, not {{WebExtAPIRef("storage.local")}} because of [this bug](https://bugzil.la/1385832).
Copy link
Member

Choose a reason for hiding this comment

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

<storageType> refers to the fragment in the code sample. Let's keep it but refer to all formats that are supported. For example, see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/remove

While looking at other docs I noticed that "writable" should be dropped from https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/get . Let's drop it (managed storage is not writable).

@rebloor rebloor requested a review from Rob--W September 2, 2024 22:39
Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

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

Approved provided that the one comment in getBytesInUse gets addressed. Feel free to request another review.

`<storageType>` can only be {{WebExtAPIRef("storage.sync")}}, not {{WebExtAPIRef("storage.local")}} because of [this bug](https://bugzil.la/1385832).
Where `<storageType>` is one of the storage types — {{WebExtAPIRef("storage.sync", "sync")}}, {{WebExtAPIRef("storage.local", "local")}}, {{WebExtAPIRef("storage.session", "session")}}, or {{WebExtAPIRef("storage.managed", "managed")}}.

In Firefox, `<storageType>` can't be {{WebExtAPIRef("storage.local")}}, because of [bug 1385832](https://bugzil.la/1385832), and {{WebExtAPIRef("storage.managed")}} isn't supported.
Copy link
Member

Choose a reason for hiding this comment

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

The current phrasing misleadingly claims that storage.managed is unsupported in Firefox. That is not the case. Another potential interpretation is that it is somehow related to the previous claim about storage.local.

To avoid confusion, consider dropping the mention of "managed" from getBytesInUse above.

Note that support is limited:

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 the best wording - followed your suggestion and added the info about Chrome to the BCD

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Sep 20, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Sep 20, 2024
Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

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

Approved with the minor issue addressed.

@dipikabh
Copy link
Contributor

dipikabh commented Oct 1, 2024

Hi @rebloor, @Rob--W, is this PR ready to be merged?
We're readying the files to publish the release notes for Firefox 131.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Oct 1, 2024
Copy link
Contributor

github-actions bot commented Oct 1, 2024

This pull request has merge conflicts that must be resolved before it can be merged.

@Rob--W
Copy link
Member

Rob--W commented Oct 1, 2024

Yes I approved and it is ready from the data perspective. There is a merge conflict now though...

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Oct 1, 2024
@rebloor rebloor merged commit dd98fd4 into mdn:main Oct 1, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree Content:WebExt WebExtensions docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants