Update async flush behavior to flush the group profile, not the current profile
Categories
(Toolkit :: Startup and Profile System, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox135 | --- | fixed |
People
(Reporter: jhirsch, Assigned: jhirsch)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidefe-profile-management])
Attachments
(1 file)
In the code review discussion for Bug 1918813, it was discovered that the "last writer wins" semantics may not be correctly implemented for updating the default profile for a group.
In the case where a selectable profile has received application focus and is trying to become the default for the profile group, it appears that SelectableProfileService.#attemptFlushProfileService() can fail:
- if the profiles.ini file has been updated since the selectable profile was launched, the call to
nsToolkitProfileService.asyncFlushwill fail, because that function throws ifGetIsListOutdatedreturns true. - as a backup, we then attempt to call
nsToolkitProfileService.asyncFlushCurrentProfile, but the call tonsToolkitProfileService.asyncFlushCurrentProfilewill fail, as the C++ function throws ifmCurrentis null, andmCurrentis always null for a selectable profile.
I have a fix in mind here: we can adjust the null-check in nsToolkitProfileService.asyncFlush to skip the GetIsListOutdated check if we are in a selectable profile, and we can adjust the unnecessary write check in SelectableProfileService.#attemptFlushProfileService to bail out only if both the group toolkit profile's rootDir equals the current profile's rootDir, but also (new condition) that the file is not outdated--if the file is outdated, it's possible someone else updated profiles.ini but we haven't read in the latest contents. Pushing a patch now with these fixes added.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 2•1 year ago
|
||
The severity field is not set for this bug.
:mossop, could you have a look please?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 3•1 year ago
|
||
Note that in the review :mossop suggested an alternative fix:
So this basically undoes bug 1915216 which means we start clobbering the profiles.ini file.
How about instead we change
AsyncFlushCurrentProfiletoAsyncFlushGroupProfileso it is checkingmGroupProfileinstead ofmCurrentProfile?
Updating the bug title accordingly
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 5•1 year ago
|
||
| bugherder | ||
Description
•