Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory-discarded tabs move to the default container when relaunching/resuming Firefox #1719

Closed
audreytoskin opened this issue Apr 23, 2020 · 11 comments
Labels
bug Something is broken! Needs: Mozilla Central Needs changes in Mozilla-Central

Comments

@audreytoskin
Copy link

audreytoskin commented Apr 23, 2020

  • Multi-Account Containers Version: 6.2.5
  • Operating System + Version: Fedora 31 Workstation x86_64 (GNOME 3.34.5, kernel 5.5.17)
  • Firefox Version: 76.0b7 (Developer Edition)
  • Other installed Add-ons + Version + Enabled/Disabled-Status: I use sort of a lot of extensions, but I still have this issue even when Multi-Account Containers is the only extension enabled...

Actual behavior

Context: When you launch Firefox and resume a previous session, tabs start out in what I think is called a "discarded" state. Right? The webpages do not all load into memory until you click on each tab. The same thing happens when you Hide and Show a container. Tabs remain discarded until you click on them.

The problem: If you exit Firefox while any of your container tabs are discarded, then when you launch Firefox again, all of that container's tabs will have switched back to the default container. You will have to reopen each tab in its previous container again.

Expected behavior

Container tabs should always stay in their containers across Firefox sessions.

Steps to reproduce

  1. Start a new Firefox profile (firefox -P test)
  2. Firefox Menu > Preferences > Startup > click the checkbox for "Restore previous session".
  3. Go to Mozilla Addons site and install Firefox Mulit-Account Containers. Leave the Addons site in the default container, so that we have a non-container tab open while opening/closing containers...
  4. Open a few tabs in one of the standard containers, say Personal. I did the Mozilla, Wikipedia, and Google home pages.
  5. Hide this container.
  6. Show this container.
  7. Only click one, or some, or none of the tabs, so that the rest of the container's tabs stay "discarded".
  8. Exit Firefox.
  9. Relaunch Firefox in your test profile again. Notice all three container tabs are now in the default container.
@audreytoskin
Copy link
Author

The workaround: Either Hide the container again, or click on any discarded tabs to "wake" them up, before exiting Firefox.

@audreytoskin audreytoskin changed the title Memory-discarded tabs move to the default container when relaunching Firefox Memory-discarded tabs move to the default container when relaunching/resuming Firefox Apr 23, 2020
@Solid-Ice8
Copy link

Perhaps this has something to do with FireFox itself?

I'm constantly closing FireFox and re-opening it to test things. I have always used "Restore Session" by default, so this was no surprise to me. I don't know when it started but, all tabs would fail to load fully. Only the last active tab opens. However, not in normal state.

I noticed all my tabs are in cache state, even the last active tab. There's even a yellow ! bubble mark that says "Loaded from Cache" "Mozilla" on the right in the address bar.

Additionally, I'm unable to "scroll" up or down to view the tabs (I use Tree Style Tabs with Middle Click to navigate to the next/previous tab).

@grahamperrin

This comment has been minimized.

@audreytoskin
Copy link
Author

Yes, I still have this problem on Firefox 89.0b3 (Developer Edition). The steps to reproduce in my original post still reproduce the bug.

@grahamperrin
Copy link

grahamperrin commented Apr 25, 2021

Thank you.

Can you make the bug reproducible with multiple windows? For containment to fail when a tab that was discarded in a second (or subsequent window) is adjacent to the first restored tab when the window is restored.

Thoughts

The potential for leakage and loss of privacy may be significant; we can not expect end users to notice whenever containment silently fails.

Given Mozilla's emphasis on privacy, IMHO the underlying bug should be P1.

Here

Without aiming to, a few hours ago I stumbled into what might be the same (Firefox) bug with a single window and Multi-Account Containers alone enabled. Three frames from a screen recording:

2021-04-25 05:37:53
2021-04-25 05:37:53

  • old.reddit.com must always be in the Personal container.

2021-04-25 05:38:13
2021-04-25 05:38:13

  • an initial click on a tab that was not in the front before quit.

2021-04-25 05:38:16
2021-04-25 05:38:16

  • old.reddit.com not contained

– the page simply loaded, without the extension asking about containment.

The preference to always open the site in the container was set (page action) and confirmed (toolbar button) during the session, not long before the affected tab loaded without containment.

It was a single-window session, with my clean profile (the other Firefox windows were from a separate run of the application with my default profile).

This example was slightly unusual in that:

  • during the previous session, the affected tab was explicitly opened in a non-contained tab
  • I intentionally made all CPUs busy (the graph in GKrellM in the second and third frames).

Whilst all CPUs were 100% busy, the computer did not feel unduly slow. Around 6 of 16 G encrypted swap was in use, however the related hard disk drive at ada0 was not thrashed (output from gstat -p in the xterm window).

https://man.freebsd.org/gstat(8)

@grahamperrin
Copy link


Off-topic from Firefox containers and the Multi-Account Containers extension,

#1719 (comment)

… all my tabs are in cache state, even the last active … "Loaded from Cache" "Mozilla" on the right in the address bar.

For many pages, this is normal. ▶ https://chat.mozilla.org/ or https://discourse.mozilla.org/ if you like to learn more. I'm grahamperrin in both areas; any number of other people should be able to help.

… unable to "scroll" up or down … Tree Style Tabs …

https://github.com/piroor/treestyletab/#user-content-if-you-have-any-request-proposal-or-unexpected-trouble-from-bugs

@grahamperrin
Copy link

#1719 (comment)

The workaround: Either Hide the container again, or click on any discarded tabs to "wake" them up, before exiting Firefox.

Another workaround:

  • the Always In Container extension

tiansh/always-in-container#6

@grahamperrin
Copy link

@Rob--W above #1719 (comment), the three frames from a screen recording.

Please: does this smell like anything that is, or should be, in the dependency tree for tab-unloading bug 1462813? ([tracking] Tab discarding)

webextensions-startup bug 1378459 also came to mind ([meta] Allow some addon functionality to load prior to any content loading), although I have not spend enough time on this issue to tell whether it's related.

@Rob--W
Copy link
Member

Rob--W commented Apr 25, 2021

@Rob--W above #1719 (comment), the three frames from a screen recording.

Please: does this smell like anything that is, or should be, in the dependency tree for tab-unloading bug 1462813? ([tracking] Tab discarding)

I don't know for sure. I read this report and comments and your screenshots, but it's not clear whether there is an issue with session restore logic in Firefox. The container state of a tab is certainly part of the properties that's restored by Firefox as part of session restore.

In https://hg.mozilla.org/mozilla-central/rev/bf8b505e273d (part of https://bugzilla.mozilla.org/show_bug.cgi?id=1695346 ), I recently (Firefox 89) fixed a bug related to detection of tab URL of discarded tabs when the tab hiding extension API is used. This MAC extension doesn't use tab hiding though.

I ran the STR here and compared Firefox's session restore files. There is no difference between the session with the restored tab and the session without. So it could be that the internal "userContextId" tab ("cookieStoreId") restored by the extension isn't persisted to session restore as expected.

@dannycolin
Copy link
Collaborator

@dannycolin
Copy link
Collaborator

Fixed by https://hg.mozilla.org/mozilla-central/rev/9db0b49bb116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken! Needs: Mozilla Central Needs changes in Mozilla-Central
Projects
None yet
Development

No branches or pull requests

5 participants