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?
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)
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 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
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.