Closed Bug 1798232 Opened 2 years ago Closed 2 years ago

Duplicating a tab after moving to a new window opens wrong site

Categories

(Firefox :: Tabbed Browser, defect, P3)

Firefox 106
defect

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox106 --- wontfix
firefox107 --- wontfix
firefox108 --- verified

People

(Reporter: calvin, Assigned: farre)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Steps to reproduce:

I can reproduce on a new Firefox profile and the latest Nightly (Build ID 20221030090504) by following these steps:

  1. Open a new tab, paste https://example.com in the address bar, and press Enter.
  2. Move the tab to a new window. (Right click the tab for context menu -> Move Tab -> Move to New Window. If this option is disabled, first open another tab so there is more than one tab in the window.)
  3. Duplicate the tab. (Right click the tab for context menu -> Duplicate Tab.)

Actual results:

Another tab is opened to the site before navigation to https://example.com.

Expected results:

Another tab is opened to https://example.com.

Component: Untriaged → Tabbed Browser
Status: UNCONFIRMED → NEW
Ever confirmed: true

:farre, since you are the author of the regressor, bug 1756995, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Flags: needinfo?(afarre)
Assignee: nobody → afarre
Severity: -- → S3
Flags: needinfo?(afarre)
Priority: -- → P3

If you do:

  1. Open a new tab, paste https://example.com in the address bar, and press Enter.
  2. Wait for more than 15 seconds
  3. Move the tab to a new window. (Right click the tab for context menu -> Move Tab -> Move to New Window. If this option is disabled, first open another tab so there is more than one tab in the window.)
  4. Duplicate the tab. (Right click the tab for context menu -> Duplicate Tab.)

then this does not reproduce. And the reason for this is that the session store tab state hasn't been flushed before moving the window.

Status: NEW → ASSIGNED

Turns out that the problem is that we don't explicitly flush a tab's session store state before moving, and the reason that bug 1756995 regressed this is that nsDocShell::EndPageLoad used to force a flush (which was bad), but bug 1756995 fixed that. And then this issue surfaced.

When moving a tab to a new window, the tab state needs to be flushed
and then copied over. Copying the current state could possibly miss
out on any buffered changes. Unfortunately we can't wait for the flush
to complete and then move, so we need to force the old state on top of
the new.

Pushed by afarre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d8b63736e65e Make sure to flush session store when moving tabs to new window. r=dao
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch

Reproduced the issue in Beta 107.0b8 using Windows 10.
Verified - Fixed in latest Nightly 108.0a1 (build id: 20221102174350).

See Also: → 1820692
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: