Translations don't work across private/non-private windows
Categories
(Firefox :: Translations, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox124 | --- | unaffected |
firefox125 | --- | verified |
firefox126 | --- | verified |
People
(Reporter: marco, Assigned: nordzilla)
References
(Regression)
Details
(Keywords: 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 |
After the first time I translate in a non-private window, translations don't work anymore in private windows.
Same happens in the other direction.
Reporter | ||
Comment 1•10 months ago
|
||
Mozregression says:
96:48.62 INFO: Last good revision: ad3e0a193f6695c9133975ca3d272236bf4fa59f
96:48.62 INFO: First bad revision: c21d8e0ee576012d309a4cbd267e9e54b660e605
96:48.62 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=ad3e0a193f6695c9133975ca3d272236bf4fa59f&tochange=c21d8e0ee576012d309a4cbd267e9e54b660e605
It could be either bug 1870327 or bug 1870300.
Assignee | ||
Comment 2•10 months ago
•
|
||
I dug into this and found that the regression is here:
Bug 1870327
https://phabricator.services.mozilla.com/D201282
This is where I refactored the way that the language lists are built to be in the shared class here.
The new code stores the initialized state based on the panel's element ID. So, when full-page-translations-panel
gets its language lists initialized, that gets put into the map as "initialized"
.
This appears to break when someone opens up a new window after translating, not just a private window.
I looked into adding the PID to the map as a differentiator, but that's not aggressive enough: all the windows still have the same parent process.
I then looked into adding the innerWindowId
as a differentiator, but that is too aggressive: even new tabs get a different innerWindowId
.
It's not really clear to me at the moment why the FullPageTranslationsPanel
class, which is a singleton class, seems to be losing information when the TranslationsPanelShared
class, which is just a class with static members and functions, is retaining information within the same process.
I'm going to keep looking into this.
Assignee | ||
Comment 3•10 months ago
|
||
Fixes an issue where the cached state for the Translations
Panel's lanuage list initializtion was too aggressive across
new window instances. Now considers the inner window id
when caching the state.
Updated•10 months ago
|
Assignee | ||
Comment 4•10 months ago
|
||
This is slightly wrong. I think in my haste to debug this I somehow logged the innerWindowId
incorrectly.
The innerWindowId
does seem to be what we want. I'm uploading a patch.
Comment 5•10 months ago
|
||
Set release status flags based on info from the regressing bug 1870327
Assignee | ||
Comment 7•10 months ago
|
||
Fixes an issue where the cached state for the Translations
Panel's lanuage list initializtion was too aggressive across
new window instances. Now considers the inner window id
when caching the state.
Original Revision: https://phabricator.services.mozilla.com/D206703
Updated•10 months ago
|
Comment 8•10 months ago
|
||
beta Uplift Approval Request
- User impact if declined: The Full-Page Translations panel will fail to populate the language lists if users attempt to translate with two Firefox windows open at the same time.
- Code covered by automated testing: no
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: Open more than one Firefox window at the same time and try to invoke Full-Page Translations in both of them
- Risk associated with taking this patch: Low risk
- Explanation of risk level: This is a few-line change that concatenates an extra identifier onto a string key to a map.
- String changes made/needed: None
- Is Android affected?: no
Comment 9•10 months ago
|
||
bugherder |
Updated•10 months ago
|
Updated•10 months ago
|
Comment 10•10 months ago
|
||
uplift |
Assignee | ||
Updated•10 months ago
|
Updated•10 months ago
|
Comment 11•10 months ago
|
||
Reproduced the issue with Firefox 126.0a1 (2024-04-04) on Windows 10x64. After opening a new normal or private window the translation panel will be empty for the Translate from
and Translate to
dropdowns.
The issue is verified fixed with Firefox 125.0RC1 and 126.0a1 (2024-04-08) on Windows 10x64, macOS 13 and Ubuntu 23.10. The Translate from
and Translate to
dropdowns are successfully populated with languages after following steps from comment 8. Note that bug 1890494 was encountered during testing.
Description
•