Preferences are lost if Mozilla/Firefox crashes

RESOLVED FIXED

Status

Other Applications
ChatZilla
--
major
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: James Ross, Assigned: James Ross)

Tracking

({regression})

Trunk
regression

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [cz-0.9.71])

Attachments

(2 attachments)

(Assignee)

Description

12 years ago
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?
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

12 years ago
Created attachment 212344 [details] [diff] [review]
Full patch for pref-manager

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)
(Assignee)

Comment 3

12 years ago
Created attachment 212345 [details] [diff] [review]
Attachment 212344 [details] [diff] with -w

This is the same patch, but using diff -w to make it clearer.

Comment 4

12 years ago
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+
(Assignee)

Comment 5

12 years ago
checked in --> FIXED.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
(Assignee)

Updated

12 years ago
Whiteboard: [cz-0.9.71]
You need to log in before you can comment on or make changes to this bug.