asyncFlushCurrentProfile assumes all toolkit profiles have different store identifiers and overwrites the wrong profile if this isn't the case
Categories
(Toolkit :: Startup and Profile System, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr140 | --- | unaffected |
| firefox149 | --- | unaffected |
| firefox150 | + | fixed |
| firefox151 | --- | fixed |
People
(Reporter: alice0775, Assigned: mossop, NeedInfo)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: nightly-community, regression)
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Firefox launches using a profile other than the one selected with firefox -p.
Steps to reproduce:
- Prerequisite: There are many profiles.
- Start nightly
Firefox -pto launch Profile selector and choose a profile, then Start Nightly. - Open about:support and check profile folder
Actual results:
Firefox launches using a profile other than the one selected.
And profiles.ini is broken.
Expected results:
Firefox should launch using the selected profile.
| Reporter | ||
Comment 2•16 days ago
|
||
It happened again.
| Reporter | ||
Comment 3•16 days ago
•
|
||
Here is an example of a profiles.ini file (number of profiles is > 50)
[Profile1]
Name=profilename111
IsRelative=1
Path=Profiles/blablabla.profilename111
[Profile2]
Name=profilename222
IsRelative=1
Path=Profiles/blablabla.profilename222
... ...
- Run
firefox -p, select the profileprofilename222, and start and close the browser. - Run
firefox -p, select the profileprofilename111, and start and close the browser.
As a result, the path for profilename222 is unexpectedly overwritten as follows:
[Profile1]
Name=profilename111
IsRelative=1
Path=Profiles/blablabla.profilename111
[Profile2]
Name=profilename222
IsRelative=1
Path=Profiles/blablabla.profilename111
... ...
| Reporter | ||
Comment 4•16 days ago
|
||
[Tracking Requested - why for this release]: Profile system will be broken after launch browser with different profiles.
Regression window:
https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=97386e6e20491aa6291afc8a6f5d4ee69bcdbef5&tochange=7bada62955268708db3bb09358944ee65c072f13
Comment 5•16 days ago
|
||
:mossop, since you are the author of the regressor, bug 2022782, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
| Reporter | ||
Updated•15 days ago
|
| Assignee | ||
Comment 6•15 days ago
|
||
Bug 2022782 only really changed the path when you've used selectable profiles previously so I assume that is the case here.
(In reply to Alice0775 White from comment #3)
[Profile1] Name=profilename111 IsRelative=1 Path=Profiles/blablabla.profilename111 [Profile2] Name=profilename222 IsRelative=1 Path=Profiles/blablabla.profilename222
Was there no StoreID property for these?
For both profiles please run the following two snippets in the browser console and let me know what they return:
SelectableProfileService.storeID
await SelectableProfileService.getAllProfiles().then(p => p.map(p => p.path))
Updated•15 days ago
|
| Reporter | ||
Comment 7•15 days ago
|
||
profile1:
21:43:50.926 SelectableProfileService.storeID
21:43:50.966 "2e42c58b"
21:44:24.933 await SelectableProfileService.getAllProfiles().then(p => p.map(p => p.path))
21:44:25.054
Array []
length: 0
<prototype>: Array []
<global>: SystemGlobal { crypto: Crypto, indexedDB: IDBFactory, locks: LockManager, … }
profile2:
21:45:25.566 SelectableProfileService.storeID
21:45:25.642 "2e42c58b"
21:45:36.558 await SelectableProfileService.getAllProfiles().then(p => p.map(p => p.path))
21:45:36.754
Array []
length: 0
<prototype>: Array []
<global>: SystemGlobal { crypto: Crypto, indexedDB: IDBFactory, locks: LockManager, … }
| Assignee | ||
Comment 8•15 days ago
|
||
What are the values of browser.profiles.created and browser.profiles.enabled in about:config in both cases?
| Reporter | ||
Comment 9•15 days ago
|
||
pofile1:
browser.profiles.created true
browser.profiles.enabled true
profile2:
browser.profiles.created true
browser.profiles.enabled true
| Assignee | ||
Comment 10•15 days ago
|
||
Ok this is somewhat related to bug 1991913. Somehow both of those profiles are assigned to the same store ID which should never happen, and on top of that the store doesn't contain any profiles leaving things in a bit of a broken state. I can see why bug 2022782 has made this start behaving more strangely.
| Reporter | ||
Comment 11•15 days ago
|
||
I suspect the presence of duplicate storeIDs is due to the following:
“Copying the profile folder using a file manager, renaming that folder using the file manager, and then registering it with the Profile Manager.”
This approach hadn’t caused any issues until now, but the problem may have surfaced after the changes made in bug 2022782.
| Assignee | ||
Updated•15 days ago
|
| Assignee | ||
Comment 12•14 days ago
|
||
We currently attempt to flush whenever a browser window is activated. In the
most common case this doesn't actually change the profile, it is just switching
between windows of the same profile. The only time we do still need to flush in
this case is if another instance has updated profiles.ini in the meantime.
Additionally this makes asyncFlushCurrentProfile safer by making it fail if more
than one profile has the same store ID or path if we are falling back to paths.
Updated•14 days ago
|
Comment 13•14 days ago
|
||
Set release status flags based on info from the regressing bug 2022782
Comment 14•14 days ago
|
||
Comment 15•13 days ago
|
||
| bugherder | ||
Comment 16•13 days ago
|
||
The patch landed in nightly and beta is affected.
:mossop, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox150towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 17•13 days ago
|
||
Yes we would want to uplift but I want to give this a couple of days bake time on Nightly first.
Alice are you able to verify that this fixes the issue for you in the next nightly?
| Reporter | ||
Comment 18•13 days ago
|
||
STR For testing:
- I delete
Profile Groupsfolder andinstalls.iniandprofiles.inifile. - And I registered two profiles that contain a
prefs.jsfile with the sametoolkit.profiles.storeIDvalue.
Results:
Even if I use latest Nightly151.0a1 (20260326095454), the issue is reproduced.
I followed the same steps as in Step 1 above.
And removed toolkit.profiles.storeID from the prefs.js file for each profile, and then re-registered them.
After doing so, the issue no longer occurred.
Comment 19•1 day ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: In an edge case users of the old profile management system may lose access to some of their profiles is they have manually modified their profiles.ini file.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: The code changes are well exercised by tests and this has been baking on nightly for nearly two weeks
- String changes made/needed?: None
- Is Android affected?: no
| Assignee | ||
Comment 20•1 day ago
|
||
We currently attempt to flush whenever a browser window is activated. In the
most common case this doesn't actually change the profile, it is just switching
between windows of the same profile. The only time we do still need to flush in
this case is if another instance has updated profiles.ini in the meantime.
Additionally this makes asyncFlushCurrentProfile safer by making it fail if more
than one profile has the same store ID or path if we are falling back to paths.
Original Revision: https://phabricator.services.mozilla.com/D289780
Updated•1 day ago
|
Updated•1 day ago
|
Comment 21•1 day ago
|
||
| uplift | ||
Description
•