Bug 1529879: Block changing the profile list when another process has changed it. r=froydnj,Gijs,flod a=pascalc l10n=flod draft
authorDave Townsend <dtownsend@oxymoronical.com>
Tue, 05 Mar 2019 12:51:44 -0800
changeset 11414 558c30ec1e28cc14f269e85114a5bdf74d5e59af
parent 11413 6fad9c918c2dcc328dda05076c11a1520c3be47a
child 11415 305b8594b7eef5705b0482a770c878246ac41070
push id206
push userflodolo@mozilla.com
push dateWed, 24 Apr 2019 06:31:52 +0000
reviewersfroydnj, Gijs, flod, pascalc
bugs1529879, 1522584, 1539868
Bug 1529879: Block changing the profile list when another process has changed it. r=froydnj,Gijs,flod a=pascalc l10n=flod On startup we record the size and modified time of the profile lists. If changed we refuse to flush any new changes to disk. Also adds a getter to check if they've changed so the UI can do something sensible. All attempts to flush are now checked for success. In some cases in early startup the failure mode isn't great, we just quit startup. The assumption though is that it's extremely unlikely that the files will have changed on disk in the time between when they are read and when profile selection occurs, likely less than a second later. The profile reset flow is changed to only delete the old profile and flush once all the migration has completed, so if something fails the user gets back to their old profile. In testing I ended up having to fix bug 1522584 so background file deletions on a background thread are safer. I haven't implemented any UI tests right now since making modifications to the profiles means modifying the actual user's profiles which I'm not keen to do. See bug 1539868. Differential Revision: https://phabricator.services.mozilla.com/D25278 X-Channel-Repo: mozilla-central X-Channel-Revision: 496a04e97a17f481899ea873155294cd3da55ea2 X-Channel-Repo: releases/mozilla-beta X-Channel-Converted-Revision: a64500e3a18b4355db601dcdeda5b348e31bb523 X-Channel-Repo: releases/mozilla-release X-Channel-Revision: 15f10287a218572a7fd47acabb40208645b4462d