Closed Bug 323237 Opened 19 years ago Closed 18 years ago

Preferences are lost if Mozilla/Firefox crashes

Categories

(Other Applications :: ChatZilla, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla-mozilla-20000923, Assigned: bugzilla-mozilla-20000923)

Details

(Keywords: regression, Whiteboard: [cz-0.9.71])

Attachments

(2 files)

After bug 304350, we removed the forced-save of the preferences file from ChatZilla. This is fine, *if* the Mozilla pref system actually did its job and saved the prefs before quit time!

So, the plan is to put the forced-save back, but a bit differently. The other bug was having issues because the (supposedly unfailing) call was, well, failing, and breaking stuff. The way I want to do it here is with two differences from the original code:

 - Wrap the code that forces the save in a try/catch and relegate any errors
   to dd(), i.e. ignore them, as there is nothing we can do about them anyway.

 - Delay the save to be a short while (maybe 10s?) after the preference has
   actually been changed. I'm not sure if the timer should be reset when
   another preference is changed, as that would leave the potential for it
   never saving, but the save must not be done inline with the change. This
   will keep the fast performance we have currently.
How 'bout reset the timer, or set it to like four seconds, but force it to save the preferences no matter what after, say, thirty seconds?
Status: NEW → ASSIGNED
This delays all saves by 5s, and will keep delaying each time a pref changes, up to a max delay of 20s (15s max for resetting, plus 5s actual timer).
Attachment #212344 - Flags: review?(samuel)
This is the same patch, but using diff -w to make it clearer.
Comment on attachment 212344 [details] [diff] [review]
Full patch for pref-manager

>+ * this much already, or we could put off a save indefinately.
"indefinitely"
Attachment #212344 - Flags: review?(samuel) → review+
checked in --> FIXED.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.71]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: