Closed Bug 1685965 Opened 5 years ago Closed 10 months ago

Document explicitly that storage.managed.get() is cached, its content reloaded only on Firefox restarts and onChange event is not supported

Categories

(WebExtensions :: Storage, task, P3)

Firefox 84
task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: andrey2013, Assigned: rbloor)

References

Details

(Keywords: dev-doc-complete)

Attachments

(2 files, 4 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Steps to reproduce:

I'm developing browser extension.

  1. Configured the location of the manifest.json.
  2. Started the extension and loaded manifest.json via storage.managed.get().then(..)
  3. The right data was loaded
  4. Manually updated manifest.json
  5. storage.managed.get().then() didn't get the new values.
  6. Waited for 16 hours and restarted the firefox
  7. storage.managed.get().then() got the new values

Actual results:

storage.managed.get() did not take the updated values in manifest.json (the file was updated manually after the extension already started)

Expected results:

I would expected storage.managed.get() to bring the updated values on manifest.json

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Product: Firefox → WebExtensions

I thought this was documented on MDN, but can't find it now. Adding doc-needed to track adding it.

Aside from that, Mike do you know if we support updates to Policy while Firefox is running for anything else?

Also also, the storage.managed page should probably mention that we also support setting it via Policy.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/managed

Severity: -- → N/A
Flags: needinfo?(mozilla)
Priority: -- → P3
Summary: storage.managed.get() is not returning the updated manifest.json → storage.managed.get() is cached and never updated, onChange event is not supported

Mike do you know if we support updates to Policy while Firefox is running for anything else?

Nope, all policy changes require a restart.

Good point on the doc changes. I need to get something documented around that.

Flags: needinfo?(mozilla)
Flags: needinfo?(lalasland100)

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit auto_nag documentation.

Flags: needinfo?(lalasland100)
Flags: needinfo?(lbethgallaway28)
Attachment #9355159 - Attachment description: xss-image.svg → xss-image.svg"><i>asd</i>
Attachment #9355159 - Attachment filename: xss-image.svg → i>

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit BugBot documentation.

Flags: needinfo?(lbethgallaway28)
Flags: needinfo?(tomica)
Flags: needinfo?(tomica)

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit BugBot documentation.

Flags: needinfo?(feeneytamara177)

Doc updates in Bug-1685965 managed storage policy update clarification #37794. However, what is the status of onChange? If an update to manage storage only occurs when the browser starts, does onChange ever fire in practice? If it doesn't, then we need a note to say that while supported it has no practical use until such time as a browser change is made to dynamically load policy changes. Do any other browsers dynamically load policy changes to manage storage?

Flags: needinfo?(tomica)

onChange definitely wouldn't make sense for us. You're right, I should update the docs.

Other browsers dynamically load policy.

Flags: needinfo?(lgreco)

A notice has been added to https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/onChanged to more explicitly mention that in Firefox the managed storage content is expected to be only reloaded on restarts and so that technically it is expected to not be emitting the browser.storage.managed.onChanged event.

Marking this as fixed (from a documentation perspective, from an implementation perspective this was already the expected behavior).

Status: UNCONFIRMED → RESOLVED
Type: enhancement → task
Closed: 10 months ago
Component: Untriaged → Storage
Flags: needinfo?(tomica)
Flags: needinfo?(lgreco)
Resolution: --- → FIXED
Summary: storage.managed.get() is cached and never updated, onChange event is not supported → Document explicitly that storage.managed.get() is cached, its content reloaded only on Firefox restarts and onChange event is not supported
Assignee: nobody → rbloor

Do we have a big for fixing the caching? we'll need to do that for Firefox Enterprise.

(In reply to Mike Kaply [:mkaply] from comment #20)

Do we have a big for fixing the caching? we'll need to do that for Firefox Enterprise.

Hi Mike,
I just took a look and we don't have one tracking support for refreshing the storage.managed data after it has been loaded before in the same Firefox session, would you mind filing one and link it to this issue as a seealso?

Flags: needinfo?(mozilla)
See Also: → 2008599
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: