Closed Bug 1893776 Opened 7 months ago Closed 6 months ago

Translations Panels do not populate language dropdowns when creating a new window from a tab that has already opened the panel

Categories

(Firefox :: Translations, defect, P3)

Desktop
All
defect

Tracking

()

VERIFIED FIXED
127 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox125 --- wontfix
firefox126 --- fixed
firefox127 --- verified
firefox128 --- verified

People

(Reporter: nordzilla, Assigned: nordzilla)

References

(Regression)

Details

(Keywords: regression)

Attachments

(5 files)

Description


Steps to Reproduce

  1. Open a Firefox window.
  2. Open a new tab such that you have at least two tabs in the current window.
  3. Navigate to a translatable website, such as https://es.wikipedia.org
  4. Open the FullPageTranslationsPanel by clicking the Translations button in the URL bar.
  5. Observe that the language dropdown menus are populated if you open them, and are pre-selected to languages, such as from Spanish to English.
  6. Close the panel.
  7. Click and drag that tab somewhere else on the screen such that the tab becomes its own new window.
  8. Reopen the FullPageTranslationsPanel by clicking the Translations button in the URL bar.

Expected Behavior

(Left side of image)

The language lists are still populated and pre-selected to languages for translation, such as from Spanish to English.

Actual Behavior

(Right side of image)

The language lists are not populated and are pre-selected to the Choose a language option, such as from Spanish to English.


Tests to implement

  • Implement a test that opens a new tab, opens the panel, then moves the tab to its own window, then opens the panel in that window to ensure it still works.

Fixes an issue where the Translations panels initialization
cache would encounter an false cache hit if a tab is dragged
to become its own new window after one of the panels was already
opened in the previous window.

Adds a test case where the FullPageTranslationsPanel is
opened from a new window after click-and-dragging a tab
to become its own window.

Depends on D208820

Summary: Translations don't work across private/non-private windows → Translations Panels do not populate language dropdowns when creating a new window from a tab that has already opened the panel

Set release status flags based on info from the regressing bug 1870327

Attachment #9398973 - Attachment description: WIP: Bug 1893776 - Ensure Translations panels init cache is correct → Bug 1893776 - Ensure Translations panels init cache is correct r=#translations-reviewers!
Attachment #9398974 - Attachment description: WIP: Bug 1893776 - Add test for FullPageTranslationsPanel in new window → Bug 1893776 - Add Translations test for tab dragged to new window r=#translations-reviewers!

Update

Whew, this has been quite the chain of regressions! My plan is to uplift this patch into Firefox 126 Beta.

I'll provide a breakdown of all the events, as well as a summary of the final resulting behaviors of all the Firefox versions.


Breakdown of Events

  1. This regression was caused by Bug 1870327 in Firefox 125.

  2. Following that, I attempted to fix the regression by fixing Bug 1889697, which was uplifted into Firefox 125.

  3. Unfortunately, that patch fixed most of the issue, but caused a different extremely-unlikely-to-occur regression in the panel's error messaging, which was fixed by Bug 1892541 and uplifted into Firefox 126.

  4. But then I realized that Bug 1889697 didn't quite fix all of the issue caused by the original regressor (Bug 1870327). It fixed the issue for opening multiple new windows all on their own, but there was still one unhandled edge case where a user can drag a pre-existing tab to become its own window, causing the panel initialization to still fail if it was already initialized in the previous window.

  5. This bug fixes that and adds a test case for that specific scenario.


Summary of behavior in each Firefox version

Assuming this gets uplifted into Firefox 126 beta, the resulting state of everything will be the following:

  • Firefox 124 will work as expected.

  • Firefox 125 will have only the issue described by this bug, where dragging an open tab to a new window and then opening the FullPageTranslationsPanel will fail to populate the dropdown menus only if the panel was opened already in the previous window. However the user will be able to fix the initialization state if they attempt to open the panel from a new tab that was crated within the new window from the start. There are no security risks here, just a minor edge-case inconvenience that is easily fixable by the user.

  • Firefox 126 will work as expected.

:nordzilla just a reminder that we are in the final week of beta for Fx126.
If you plan on landing this and requesting an uplift then we don't have much time.

Flags: needinfo?(enordin)

Hey Donal, thanks for the reminder.

Greg (the reviewer) was out on Friday and I was out on Monday. Just some unfortunate timing.

All the reviews etc. are approved now and I'll be landing this today.

Flags: needinfo?(enordin)
Pushed by enordin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/83bd68625e79 Ensure Translations panels init cache is correct r=translations-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/45fc4d710ebf Add Translations test for tab dragged to new window r=translations-reviewers,gregtatum

I will request uplift for this as soon as I get confirmation that this is not only in autoland, and is fully resolved and in central.

I pushed it 20 hours ago, and it doesn't usually take so long. I'll keep monitoring it.

I don't want to request uplift if it were to be backed out for some reason (though I have high confidence it won't be).

Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch

Fixes an issue where the Translations panels initialization
cache would encounter an false cache hit if a tab is dragged
to become its own new window after one of the panels was already
opened in the previous window.

Original Revision: https://phabricator.services.mozilla.com/D208820

Attachment #9399696 - Flags: approval-mozilla-beta?

Adds a test case where the FullPageTranslationsPanel is
opened from a new window after click-and-dragging a tab
to become its own window.

Original Revision: https://phabricator.services.mozilla.com/D208821

Attachment #9399697 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Dragging an open tab to a new window and then opening the FullPageTranslationsPanel will fail to populate the dropdown menus only if the panel was opened already in the previous window. However the user will be able to fix the initialization state if they attempt to open the panel from a new tab that was crated within the new window from the start.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: STR described in bug
  • Risk associated with taking this patch: Low
  • Explanation of risk level: This only affects the Translations panel init cache, which are well tested in general and have a new test case for this specific edge-case.
  • String changes made/needed: None
  • Is Android affected?: no
Attachment #9399696 - Attachment description: Bug 1893776 - Ensure Translations panels init cache is correct r=#translations-reviewers! → Bug 1893776 - Ensure Translations panels init cache is correct r=#translations-reviewers,gregtatum
Attachment #9399697 - Attachment description: Bug 1893776 - Add Translations test for tab dragged to new window r=#translations-reviewers! → Bug 1893776 - Add Translations test for tab dragged to new window r=#translations-reviewers,gregtatum
Attachment #9399697 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9399696 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I managed to reproduce this issue in Nightly v127.0a1 (2024-04-28) and verified the fix in Nightly v128.0a1 (2024-05-29) on Windows 10, MacOS11 and Ubuntu22.

Status: RESOLVED → VERIFIED
OS: Unspecified → All
Hardware: Unspecified → Desktop
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: