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