Recommended preferences aren't always reset during shutdown
Categories
(Remote Protocol :: Agent, defect, P2)
Tracking
(firefox91 fixed)
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: ybmzlonlttswiokwnn, Assigned: jdescottes)
References
(Blocks 1 open bug)
Details
(Whiteboard: [bidi-m1-mvp])
Attachments
(3 files)
--remote-debugging-port makes fcitx5 not usable (prefs.js changed too many)
OS = Archlinux (up-to-date)
Firefox = 89.0.1 64 bit (installed by pacman)
after I ran the following command
firefox --remote-debugging-port 9222
at this moment it's still ok with fcitx5(ctrl+space could switch the input methods)
but after I quit Firefox and re-open firefox no matter with or without the --remote-debugging-port arguments, the fcitx5 could not be activated any more.
After some digging, I found that the prefs.js is some key to the problem:
I first refresh the firefox and backupt the profile folder, and ran with --remote-debugging-port, and restore the prefs.js, then it's ok.
Then I make the prefs.js read-only with the following command:
chmod -w ~/.mozilla/firefox/ipc15uv0.default-release-1623942976332/prefs.js
this time of course the --remote-debugging-port arg not affect the fcitx5.
So, what happened? lol
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 1•3 years ago
|
||
#related softwares installed
pacman -Qs fcitx5
local/fcitx5 5.0.8-1 (fcitx5-im)
Next generation of fcitx
local/fcitx5-chinese-addons 5.0.6-2
Addons related to Chinese, including IME previous bundled inside fcitx4
local/fcitx5-configtool 5.0.5-1 (fcitx5-im)
Configuration Tool for Fcitx5
local/fcitx5-gtk 5.0.7-1 (fcitx5-im)
Fcitx5 gtk im module and glib based dbus client library
local/fcitx5-qt 5.0.6-1 (fcitx5-im)
Fcitx5 Qt Library
pip freeze | grep selenium
selenium==3.141.0
Comment 2•3 years ago
|
||
Thanks for the report. So the preferences the Remote Agent sets are the following:
https://searchfox.org/mozilla-central/source/remote/cdp/RecommendedPreferences.jsm
But usually all of them should be reset when Firefox gets closed. Could you please check if focusmanager.testmode
is still true
? If that is the case does resetting this preference help?
Reporter | ||
Comment 3•3 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #2)
Thanks for the report. So the preferences the Remote Agent sets are the following:
https://searchfox.org/mozilla-central/source/remote/cdp/RecommendedPreferences.jsmBut usually all of them should be reset when Firefox gets closed. Could you please check if
focusmanager.testmode
is stilltrue
? If that is the case does resetting this preference help?
Yep I check the about:config
's focusmanager.testmode
.
First I ran command firefox --remote-debugging-port
, that config item is true.
I close this test session.
I open the Firefox without --remote-debugging-port
args, that config item is still true
.
When I manually toggle it to false
, the fcitx5 is running well again with Firefox.
I guess it might be some failure of some post-tasks after firefox(the relevant version) was closed.
Reporter | ||
Comment 4•3 years ago
|
||
When I manually toggle it to false,
and re-open the firefox,
the fcitx5 is running well again with Firefox.
Comment 5•3 years ago
|
||
Thanks for testing that, and I finally can reproduce this behavior. As it looks like resetting the recommended preferences does not (always) work.
Julian, I can remember that you told recently that resetting the prefs in Remote Agent happens kinda late during shutdown. Maybe that is the problem and the preferences aren't accessible anymore at this time? Will this maybe fixed by your work on bug 1693803?
Assignee | ||
Comment 6•3 years ago
|
||
Thanks for the ping! In its current shape, my patch for bug 1693803 doesn't fix the issue.
However I tried to additionally observe "quit-application"
and cleanup preferences there, and this seems to work fine.
So I think we could try the following logic change:
- clients (marionette/cdp/etc...) only set preferences when they start
- clients no longer attempt to reset preferences in their close/destroy codepath
- instead RecommendedPreferences observes "quit-application" in order to cleanup all the altered preferences correctly
This means that preferences can not be dynamically "reset" if you quit a client while Firefox is still running, but I don't think this is really a supported use case.
What do you think?
Assignee | ||
Updated•3 years ago
|
Comment 7•3 years ago
|
||
As discussed with Julian we will add an observer for xpcom-will-shutdown
and handle resetting the recommended preferences similarly to Marionette. Right now it looks like that the RemoteAgent's close()
method is simply called too late during the application shutdown, and that the preferences module isn't available anymore.
Assignee | ||
Comment 8•3 years ago
|
||
Actually xpcom-will-shutdown
does not work and occurs too late as well. Therefore marionette has the exact same issue. STRs:
- make sure you use a clean profile
- ./mach run --marionette
- quit Firefox
- ./mach run
- check the value of
focusmanager.testmode
in about:config
ER: Should be false (default)
AR: Is still true
Instead, using quit-application
(same as devtools for instance) seems to be invoked at the correct time. I don't know if we want to fix marionette as well in this bug, but I'll split this in 2 patches in any case.
Comment 9•3 years ago
|
||
Oh wow. That is a good find! I'm happy with either approach. I wonder if there is a way to actually get this tested. I assume we would have to parse the prefs.js
file given that Firefox cannot run at that time.
Assignee | ||
Comment 10•3 years ago
|
||
Assignee | ||
Comment 11•3 years ago
|
||
Depends on D119070
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1f48b7266532
https://hg.mozilla.org/mozilla-central/rev/f4dfcf4c7f70
Description
•