Closed
Bug 1059525
Opened 10 years ago
Closed 10 years ago
sdk/simple-storage is empty for a short period when required during add-on update
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1058840
People
(Reporter: xrsquared, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140716183446
Steps to reproduce:
Consider the following add-on:
const { storage } = require("sdk/simple-storage");
console.log(JSON.stringify(storage));
console.log(storage.cat);
storage.cat = {
"_id": "53fe53f82040492621d6da44",
"index": 0,
"guid": "bd1f2b46-0d48-418e-b496-b612cc8f9ce0",
"isActive": false,
"balance": "$3,640.61",
"picture": "http://placehold.it/32x32",
"age": 20,
"eyeColor": "blue",
"name": "Santos Schwartz",
"gender": "male",
"company": "XOGGLE",
"email": "santosschwartz@xoggle.com",
"phone": "+1 (956) 465-2844",
"address": "110 Waldorf Court, Gouglersville, Texas, 5111",
"about": "Reprehenderit exercitation officia veniam ad cillum incididunt ullamco. Exercitation ut anim ullamco ad nulla aliquip cupidatat. Sit adipisicing laborum commodo labore nisi dolore esse magna ex cupidatat nulla labore quis. Amet enim amet sit id nostrud laborum mollit consectetur exercitation aliquip magna aliquip. Commodo Lorem pariatur aliqua non et deserunt eu officia aute aliqua officia. Ea reprehenderit officia et id consequat nostrud deserunt minim magna eu mollit. Sunt duis reprehenderit aute cillum eu nisi exercitation.\r\n",
"registered": "2014-01-04T04:19:06 +05:00",
"latitude": 26.814909,
"longitude": -134.251539,
"tags": [
"sunt",
"excepteur",
"dolore",
"ullamco",
"magna",
"do",
"proident"
],
"friends": [
{
"id": 0,
"name": "Ballard Collier"
},
{
"id": 1,
"name": "Lorrie Mcknight"
},
{
"id": 2,
"name": "Bertha Barber"
}
],
"greeting": "Hello, Santos Schwartz! You have 3 unread messages.",
"favoriteFruit": "apple"
};
1. Install the add-on
2. Install the add-on again
Actual results:
The console outputs
"{}"
undefined
for the second install
Expected results:
The output should be a string of non-empty object that contains the object previously saved under the "cat" field, followed by the object.
This bug only occurs when the objects stored in simple-storage is fairly sized. I don't run into this bug when cat is just a short string. Also, if I put this code inside a setTimout for a few seconds, it works as expected.
Another interesting thing is, the bug seems to go away if the data is unchanged for a while(Firefox loaded it in memory?) After changing the data slightly, the problem comes back.
Updated•10 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•