Closed Bug 1358735 Opened 7 years ago Closed 7 years ago

Container tabs are intermittently not restored in a container

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 55
Tracking Status
firefox55 --- verified

People

(Reporter: marco, Assigned: u462496)

References

Details

Attachments

(1 file)

I'm seeing this intermittently. After a session restore, some tabs lose the container information and are restored in the default container instead of the container they are supposed to be in.
(In reply to Marco Castelluccio [:marco] from comment #0)
> I'm seeing this intermittently. After a session restore, some tabs lose the
> container information and are restored in the default container instead of
> the container they are supposed to be in.

Hi Marco, I am not following you when you speak of "containers".  Can you give more details?
I can reproduce the problem.

Reproducible : always

Steps To Reproduce:
1. Set "When Firefox starts" to "Show my windows and tabs from last time"
2. Open 3 tabs (for example)
  tab 1: [about:home]
  personal container tab1 2: [https://developer.mozilla.org/en-US/Add-ons/WebExtensions]
  personal container tab1 3: [https://developer.mozilla.org/en-US/Add-ons/WebExtensions]
3. Restart browser twice

Actual Results:
 the container tab unexpectedly changes to normal tab.

Expected Results:
 the container tab should be restored as before
(In reply to Alice0775 White from comment #2)
> I can reproduce the problem.
> 
> Reproducible : always
> 
> Steps To Reproduce:
> 1. Set "When Firefox starts" to "Show my windows and tabs from last time"
> 2. Open 3 tabs (for example)
>   tab 1: [about:home]
>   personal container tab1 2:
> [https://developer.mozilla.org/en-US/Add-ons/WebExtensions]
>   personal container tab1 3:
> [https://developer.mozilla.org/en-US/Add-ons/WebExtensions]
> 3. Restart browser twice
> 
> Actual Results:
>  the container tab unexpectedly changes to normal tab.
> 
> Expected Results:
>  the container tab should be restored as before

If you set `browser.sessionstore.restore_tabs_lazily` to false, do you still get this behavior?
(In reply to Kevin Jones from comment #3)
> 
> If you set `browser.sessionstore.restore_tabs_lazily` to false, do you still
> get this behavior?

When set `browser.sessionstore.restore_tabs_lazily` to false, the problem dos not occur. It works as expected.
Blocks: 1345090
I am seeing that if the browser is restarted while the container tabs have been restored, they will remain intact.  It is when the browser has been shut down but the tabs have never been restored for that session, that the next time the browser starts, they lose their container identity.

Can anyone tell me where to find the API which manages container tabs or how their data is persisted?  I do not find any clues in sessionstore.js.
If you want to learn more about containers, start here:

https://wiki.mozilla.org/Security/Contextual_Identity_Project/Containers

An interesting question is if this issue manifests itself with the Test Pilot add-on or just the container implementation in Nightly:

https://testpilot.firefox.com/experiments/containers
I confirm that tab lazy loading is the problem as it doesn't affect pinned tabs (that are now lazy loaded AFAIK).
userContextId doesn't get set in TabStateCache if the lazy tab never gets fully restored.  This patch assures it gets set during window restore.
Attachment #8861372 - Flags: review?(mdeboer)
Comment on attachment 8861372 [details] [diff] [review]
1358735_patch_ensure_userContextId_always_set_in_TabStateCache_V1.diff

Review of attachment 8861372 [details] [diff] [review]:
-----------------------------------------------------------------

Ah! makes sense.
Attachment #8861372 - Flags: review?(mdeboer) → review+
Assignee: nobody → kevinhowjones
Status: NEW → ASSIGNED
Mike, can you push this please?
Flags: needinfo?(mdeboer)
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/91188e528813
Ensure userContextId is always set in TabStateCache. r=mikedeboer
Keywords: checkin-needed
Flags: needinfo?(mdeboer)
https://hg.mozilla.org/mozilla-central/rev/91188e528813
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
I have reproduced this on Firefox Nightly according to (2017-04-22)

Fixing bug is verified on Latest Nightly--Build ID : (20170430030208),User Agent: Mozilla/5.0 (Windows NT 6.1; rv:55.0) Gecko/20100101 Firefox/55.0

Tested OS-- Windows7 32bit

[bugday-20170426]
Thanks!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: