How To Use Storage Recovery
how to use storage recovery
Add-on SDK 1.4.3 Released | Mozilla Add-ons Blog
We have identified a serious bug in the 1.4.* releases, and have made a hotfix release of the Add-on SDK. The hotfix release is version 1.4.3.
If you are potentially affected by the bug, then you will need to take action to recover from it.
This note explains:
- how to work out whether you are potentially affected
- what the impact is
- how to recover from the bug
- what went wrong
Are You Affected?
You are potentially affected by this bug if you meet ALL THREE OF the following conditions:
Groundwater Recharge and Wells: A Guide to Aquifer Storage RecoveryLearn more
R. David G. Pyne
- Your add-on uses any of the following SDK modules: simple-storage, passwords, simple-prefs. Using passwords is only a problem if you're using it to store passwords specific to your add-on, rather than just web site passwords).
- You did not explicitly specify an ID for your add-onThis means: you didn't edit your "package.json" file to set your add-on's ID, so the first time you ran `cfx`, it generated an ID for you in "package.json".If you're not sure about this, open your add-on's "package.json" file and examine its "id" entry. If it does not contain �This module won't ship with the SDK itself, though.
Learn more
P. Dillon
- If you're using the Add-on SDK, download "recovery.js" from https://gist.github.com/1733262 and save it in your add-on's "lib" directory.
- If you're using the Add-on Builder, move your mouse over "Libraries" in the left-hand sidebar until a plus sign appears next to it, then click the plus sign. Then in the dialog type "recovery" and select "recovery by gozala" to add it to your project:
You need to import the recovery module in the normal way:
var recovery = require('recovery');
The recovery module contains any data that was written using simple-storage, simple-prefs, and passwords while your add-on was built with the 1.4, 1.4.1, or 1.4.2 releases of the SDK. The data is stored as three properties, one for each module:
recovery.storage
recovery.prefs
recovery.passwords
You'll need to merge these properties with the data stored in simple-storage, simple-prefs, and passwords in whichever way makes sense for your add-on.
The files at https://gist.github.com/1733262 include some examples of performing this merge using the recovery module.
What Went Wrong
SDK-based add-ons have an ID, which is used for, among other things, figuring out which stored data belongs to this add-on. The ID is stored in the add-on's "package.json" file. If you do not specify an ID for your add-on by editing "package.json" directly, then the SDK generates one for you automatically.
This auto-generated ID in "package.json" looks something like "jid1-y1AFbAhD9jXVcg". The SDK takes this value and appends �#jetpack
report a bug
check out the source and contribute bug fixes, enhancements, or documentation
0 コメント:
コメントを投稿