Closed Bug 723502 Opened 14 years ago Closed 14 years ago

simple-storage examples should show the pattern for updating simple-storage

Categories

(Add-on SDK Graveyard :: Documentation, defect, P2)

x86
All
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wbamberg, Assigned: wbamberg)

Details

Attachments

(1 file)

As reported by colinkeenan in the forum: https://forums.mozilla.org/addons/viewtopic.php?f=27&t=4672. Also, the doc should explain the because `cfx run` always uses a new profile, you need to build and install an add-on, or use --profiledir, to test it.
Attached patch Added more stuffSplinter Review
Added some information on things that confuse people about simple-storage: - working with cfx run - working with arrays - deleting properties
Attachment #598299 - Flags: review?(dietrich)
Comment on attachment 598299 [details] [diff] [review] Added more stuff Review of attachment 598299 [details] [diff] [review]: ----------------------------------------------------------------- ::: packages/addon-kit/docs/simple-storage.md @@ +32,4 @@ > var ss = require("simple-storage"); > ss.foo = "I will not be saved! :("; > > +Simple Storage and "cfx run" Should you put this here in so much detail, or rather link to the docs for this? my concern is that cfx seems more difficult to use after this, instead of simple 'cfx run'. however, once you use local.json it stays short and sweet. also, the docs can get out of sync when reproduced in multiple places like this. @@ +56,5 @@ > +If you use this method, you must end your debugging session by > +quitting Firefox normally, not by cancelling the shell command. > +If you don't close Firefox normally, then simple storage will > +not be notified that the session is finished, and will not write > +your data to the backing store. really?! i didn't know that. do we really not write storage data until shutdown? that seems like a bug for reals.
Attachment #598299 - Flags: review?(dietrich) → review+
Thanks Dietrich. (In reply to Dietrich Ayala (:dietrich) from comment #2) > Comment on attachment 598299 [details] [diff] [review] > Added more stuff > > Review of attachment 598299 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: packages/addon-kit/docs/simple-storage.md > @@ +32,4 @@ > > var ss = require("simple-storage"); > > ss.foo = "I will not be saved! :("; > > > > +Simple Storage and "cfx run" > > Should you put this here in so much detail, or rather link to the docs for > this? > > my concern is that cfx seems more difficult to use after this, instead of > simple 'cfx run'. however, once you use local.json it stays short and sweet. > > also, the docs can get out of sync when reproduced in multiple places like > this. Sure, I'll just link to the bit of the cfx docs that covers --profiledir. > @@ +56,5 @@ > > +If you use this method, you must end your debugging session by > > +quitting Firefox normally, not by cancelling the shell command. > > +If you don't close Firefox normally, then simple storage will > > +not be notified that the session is finished, and will not write > > +your data to the backing store. > > really?! i didn't know that. do we really not write storage data until > shutdown? that seems like a bug for reals. This was hurting my head this morning, I couldn't understand why --profiledir wasn't working. It looks to me as if simple-storage writes to the backing store: * periodically, at an interval determined by either the value of "extensions.addon-sdk.simple-storage.writePeriod", or equal to 5 minutes: https://github.com/mozilla/addon-sdk/blob/master/packages/addon-kit/lib/simple-storage.js#L18. * when it gets the "unload" event from api-utils/unload.js: https://github.com/mozilla/addon-sdk/blob/master/packages/addon-kit/lib/simple-storage.js#L121 I suppose that when you just kill the cfx command, the unload event doesn't get sent (?). I'm not sure whether there are real-world cases outside cfx run where this would cause us to lose data.
Commit pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/d1540970006b57dfc9e71a593138388dbddf358c Bug 723502 - simple-storage examples should show the pattern for updating simple-storage; r=@dietrich
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: