Re: Losing simple storage data

66 views
Skip to first unread message

db

unread,
Jul 3, 2013, 3:53:39 PM7/3/13
to mozilla-la...@googlegroups.com
Hi Sylvain,

Did you happen to figure out your issue? I think we may be running into something similar and haven't been able to track it down.

Thanks,
Dennis

On Monday, March 25, 2013 4:11:04 AM UTC-5, Sylvain GOUMY wrote:
Hi all,

I'm facing an issue with simple-storage module.
We have about a few hundreds plugin installed, each ones are identifyed with a plugin_key, but some of them are loosing the data it contains for an unknow reason.

I register a plugin key for each of my installs, on first launch.
Here is the code snipet:

//Retreive SDK libraries
var ss = require("sdk/simple-storage");
var Request = require("sdk/request").Request;

exports.main = function(options, callbacks) {
    if(options.loadReason == "install") {
        var install = Request({
            url: base_url + 'install.php',
            onComplete: function (response) {
                if (response) {
                  ss.storage.plugin_key = response.json.plugin_key;
                  ss.storage.install_time =  new Date().getTime();
                }
            }
        });
        install.post();
    }
}

This ss.storage.plugin_key is what allows the plugin to communicate uniquely with my server.

But some plugins loose it and can't communicate anymore...

I've added this code snippet to check what's happening :

      if(!ss.storage.plugin_key) {
            //hum embarassing, we lost our plugin key..
            var lost_req = Request({
                url: base_url + 'lost.php?r='+options.loadReason,
                content : 'data=' + encodeURIComponent(JSON.stringify(ss.storage))
            });
            lost_req.post();
        }

My lost request server side is logging the data, load reason is manly "startup" and simple storage is effectively an empty object...
Sometimes however, the storage still contains the install_time...

I can't figure out what's happening with the storage, and any help or even a simple clue would be really appreciated.

Some usefull additionnal infos:
- I'm using SDK 1.13 on add-on builder,
- I can't reproduce it, and it only happends on a few percent of my modules,
- I'm using an overQuota listener and I'm never going over it, storing really little data,
- it seems to happen only to users having firefox 19.0, but with any kind of OS.


Thank you so much for anyone who could help :)

Regards,
Sylvain


Reply all
Reply to author
Forward
0 new messages