Closed Bug 1328616 Opened 4 years ago Closed 4 years ago

storage.local.get returns array instead of object in Firefox <=51


(Developer Documentation Graveyard :: Add-ons, defect, P2)



(Not tracked)



(Reporter: geoffreydebelie, Unassigned)



(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Build ID: 20161213204721

Steps to reproduce:

Important parts from the code:

var getScrollValue = function(id) -> storage.local.get is called
var value = function(result) -> the result is processed. Note the if(isLowFirefoxVersion()) as a workaround for this (suspected) bug.

Actual results:

storage.local.get returns an array in Firefox <=51

  "key": "value"

In Firefox >=52 this works correctly and an object is returned (see below).

Expected results:

storage.local.get should return an object:

  "key": "value"
I just did a quick test on Firefox 50.1 and I do get an object back from storage.local.get. Can you create a reduced test case that reproduces this behaviour on Firefox < 52?
Flags: needinfo?(computergeoffrey)
Test case. Output with Firefox 50.1.0:

Getting result..  testlocalstorage.js:16:2
An array  testlocalstorage.js:18:3
[{"scrollvalue":600}]  testlocalstorage.js:22:2

Source (zip also contains manifest):
var onSuccess = function(result){
	console.log("Getting result..");
		console.log("An array");
		console.log("Not an array");

var onError = function(result){
	scrollvalue: 600
var getting1 ="scrollvalue");
getting1.then(onSuccess, onError);
Flags: needinfo?(computergeoffrey)
It is reproducible when run from a content script, but not when run from a background script, and I can see that on Firefox 50.1 an array is returned while on 53 an object is returned, so this does look like a bug. I'll leave it to be triaged in case anyone else has any quick ideas about what the cause may be, and whether a fix needs to be uplifted. Thanks Geoffrey.
Ever confirmed: true
believe regression introduced and then fixed in 52.  Timing wise we won't be able to uplift into Beta before 51 goes to release.  Add to release notes.  Matt Wein will document
Closed: 4 years ago
Flags: needinfo?(mwein)
Keywords: dev-doc-needed
Priority: -- → P2
Resolution: --- → WONTFIX
matt will write up docs to let folks know issue in 51.
Component: WebExtensions: Untriaged → Add-ons
Product: Toolkit → Developer Documentation
This is already documented in the warning box at
Flags: needinfo?(mwein)
Thanks to Makyen for adding in the documentation
You need to log in before you can comment on or make changes to this bug.