Closed Bug 1779277 Opened 4 years ago Closed 1 year ago

Moving tab, which came from another device, into new window will break it

Categories

(Core :: Session Restore, defect)

defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox-esr115 --- wontfix
firefox125 --- wontfix
firefox126 --- wontfix
firefox127 --- wontfix
firefox128 --- wontfix

People

(Reporter: juraj.masiar, Unassigned)

References

(Regression)

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0

Steps to reproduce:

  1. open any extension page (uBlock dashboard page for example)
  2. open the console and execute:
// this code will move received tab into new window
browser.tabs.onCreated.addListener(async tab => {
  console.log('tab created', tab);
  // sent tabs has this flag on
  if (!tab.attention) return;
  await browser.windows.create({tabId: tab.id});
});
  1. using another device, send tab to this device
  2. after it's received (and moved to a new window), right click on the tab and select "Duplicate Tab"

Actual results:

Empty tab is opened!
But that's not all, the tab is now broken and it will disappear after restarting Firefox, even if you have your session saved / restored. It's like the tab is not really there.

Expected results:

The tab should be duplicated and it should be saved by session restore.

This is a regression.
I've build addon "Send Tab to Device Enhancer" which does this (moves received tab into own window) and now these tabs disappears when I restart Firefox :(

https://addons.mozilla.org/en-US/firefox/addon/send-tab-to-device-enhancer/

I was able to reproduce this issue, so I performed a bisection in order to find the regresion with following results:

https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=dca4ad1dba273dfe205fc1e9d65eaf7e81502d7d&tochange=ba973417adb8c738b0ab57328fd28133c77bcf5b

2022-07-14T15:39:03: DEBUG : Found commit message:
Bug 1739450 - Part 2: Collect session history when wireframes are collected. r=peterv,mconley

Status: UNCONFIRMED → NEW
Ever confirmed: true

The severity field is not set for this bug.
:mixedpuppy, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mixedpuppy)

Andreas is out for an extended period, can you look and see if the regression makes sense for this behavior?

Flags: needinfo?(mixedpuppy) → needinfo?(peterv)

Hi Juraj, I was wondering: if you drag the drag got opened through sync manually by dragging and dropping the tab in a new window, does that also trigger a similar kind of issue?

Flags: needinfo?(juraj.masiar)

Could you rephrase that? :)
But to clarify,

  • the tab is opened all the time
  • it's only moved from current window into newly created window using browser.windows.create({tabId: tab.id})
  • the tab looks OK, it can be reloaded, it can be dragged and dropped into another window
  • the tab can't be duplicated
  • if you close the tab (and you have one more tab opened in the same window), you can't reopen it with Ctrl + Shift + T

You can reproduce this super easily, just run the code above in your Firefox and send it some tab from your phone.

Flags: needinfo?(juraj.masiar)

(In reply to juraj.masiar from comment #5)

Could you rephrase that? :)

sure thing, sorry for not having been clear.

I was wondering if the bug would be reproducible (without an extension) if a user does the same kind of operation but manually (by creating a new window and then drag and dropping the tab opened through sync into the new window), instead of being the extension moving the tab using the WebExtensions APIs.

I was wondering that mainly to confirm if the issue may be triggered due to something that the extension API is doing internally or if it is happening as a side-effect of the code handling the tab adoption (which is shared between both the WebExtensions APIs and the Firefox code handling the user being drag and dropping tabs between windows).

Flags: needinfo?(juraj.masiar)

Oh, I see, very good question!
And the answer is YES, when I drag and drop the received tab outside the window, new window is created and the tab is broken.

So it's not related to extensions after all!

Flags: needinfo?(juraj.masiar)

(In reply to juraj.masiar from comment #7)

Oh, I see, very good question!
And the answer is YES, when I drag and drop the received tab outside the window, new window is created and the tab is broken.

So it's not related to extensions after all!

Thanks a lot for double-checking that, very much appreciated!!!

It is pretty common for extensions to be able to trigger corner cases (or races) that can be technically be triggered by a user without any extension involved, and so once we got a clear STR it is often useful to confirm if it can be also reproduced without an extension, because it helps to look in the right place for where the actual underlying issue is (and often where it would be more reasonable to fix it).

The reporter confirmed that the regression can be reproduced without an extension (by manually moving tab opened by sync into a new window as a user could do without any extension installed) and so moving to "Firefox :: Session Restore" for further investigation.

Component: Frontend → Session Restore
Product: WebExtensions → Firefox

Possibly related to Bug 1793598 or Bug 1779277.

removing old ni?

Flags: needinfo?(peterv)

Andreas, can you look into this please? It looks like it might have been regressed by bug 1739450.

Flags: needinfo?(afarre)
Keywords: regression
Regressed by: 1739450

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

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

(In reply to Sarah Clements [:sclements] from comment #12)

Andreas, can you look into this please? It looks like it might have been regressed by bug 1739450.

Yeah, this is pretty much saying that it was regressed by Fission, so it's difficult to say what and how happened in bug 1739450 that caused this. This could very much be a missing flush that needs to happen, I really don't know.

I think I'd like to send this back to triage, because I don't know how to fix this.

Flags: needinfo?(afarre)
Product: Firefox → Core
Version: Firefox 103 → unspecified
Severity: -- → S3

Sarah, it seems like I'm not able to reproduce this. Not sure if I ever was. Are you ok with me closing it as won't fix?

Flags: needinfo?(sclements)

I can confirm I'm unable to reproduce it anymore. Moving received tab into new window doesn't break it anymore.

Status: NEW → RESOLVED
Closed: 1 year ago
Flags: needinfo?(sclements)
Resolution: --- → WORKSFORME

(In reply to Andreas Farre [:farre] from comment #16)

Sarah, it seems like I'm not able to reproduce this. Not sure if I ever was. Are you ok with me closing it as won't fix?

Yup, thanks for looking into it.

You need to log in before you can comment on or make changes to this bug.