The guest profile is created at every startup

VERIFIED FIXED in Firefox 25

Status

()

Firefox for Android
General
VERIFIED FIXED
5 years ago
2 years ago

People

(Reporter: u421692, Assigned: bnicholson)

Tracking

25 Branch
Firefox 26
ARM
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox25+ verified, firefox26 verified, fennec25+)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

5 years ago
Created attachment 786234 [details]
session_restore_log

Environment:
Device: LG Nexus 4 (Android 4.2.2)
Build: Nightly 25.0a1 (2013-08-05)

Steps to reproduce:
1. Open Firefox
2. Open Menu->Settings->Customize->Tabs and change to "Never restore" option
3. Restart Firefox to make sure changes take effect(after restarting the app "Never restore" is still checked).
4. Open three web pages, each one in a different tab. 
5. Restart/Kill Firefox.
6. Open Firefox.

Expected results:
Only "about:home" page is opened.

Actual results:
All the tabs from previous session are restored.

Updated

5 years ago
Assignee: nobody → bnicholson
tracking-fennec: --- → ?
status-firefox25: --- → affected
status-firefox26: --- → affected
Using this doc as a guide:
https://wiki.mozilla.org/Mobile/SessionRestore

I would guess that step #5 would be considered a "manual kill" and should not restore tabs unless the setting was in "always".
(Reporter)

Comment 2

5 years ago
No matter what settings I chose, the tabs are always restored.

Updated

5 years ago
Duplicate of this bug: 902991
tracking-fennec: ? → 25+
(Assignee)

Comment 4

5 years ago
Looks like maybeCleanupGuestProfile() is broken and always returns true, which means we always do a restore: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/BrowserApp.java#415.

Here, we do getGuestDir() to prevent creating the dir, like the comment says: http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoProfile.java#182. But then immediately after that, we call getGuestProfile(), so we're creating and then immediately removing the guest profile at every startup.
Blocks: 896092
No longer depends on: 896515
(Assignee)

Updated

5 years ago
Summary: Session restore does not take into account the session restore settings → The guest profile is created at every startup
(Assignee)

Comment 5

5 years ago
Created attachment 789183 [details] [diff] [review]
Don't try to fetch guest profile if it doesn't exist
Attachment #789183 - Flags: review?(wjohnston)
Attachment #789183 - Flags: review?(wjohnston) → review+
(Assignee)

Comment 6

5 years ago
Comment on attachment 789183 [details] [diff] [review]
Don't try to fetch guest profile if it doesn't exist

Still doesn't work. The second problem is that Context#getDir (http://developer.android.com/reference/android/content/Context.html#getDir%28java.lang.String,%20int%29) creates the directory if it doesn't exist, but the code assumes it doesn't.
Attachment #789183 - Flags: review+
(Assignee)

Comment 7

5 years ago
Created attachment 789196 [details] [diff] [review]
Don't try to fetch guest profile if it doesn't exist, v2

Changed to use getFileStreamPath (http://developer.android.com/reference/android/content/Context.html#getFileStreamPath%28java.lang.String%29) which gets the path without auto-creating anything.
Attachment #789183 - Attachment is obsolete: true
Attachment #789196 - Flags: review?(wjohnston)
Attachment #789196 - Flags: review?(wjohnston) → review+
https://hg.mozilla.org/mozilla-central/rev/75142ef8019a
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
(Assignee)

Updated

5 years ago
status-firefox26: affected → fixed
(Assignee)

Comment 10

5 years ago
Comment on attachment 789196 [details] [diff] [review]
Don't try to fetch guest profile if it doesn't exist, v2

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 896092
User impact if declined: The session will always be restored at startup. The expected behavior is that if Fennec is swipe-killed, the session will not be restored. Should also improve startup performance by removing unnecessary I/O.
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): very low risk
String or IDL/UUID changes made by this patch: none
Attachment #789196 - Flags: approval-mozilla-aurora?

Updated

5 years ago
Depends on: 906030
This broke Guest Mode on mozilla-central, see bug 906030.

Updated

5 years ago
Attachment #789196 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Whiteboard: [don't uplift until bug 906030 is resolved]

Updated

4 years ago
tracking-firefox25: --- → +
(Assignee)

Comment 12

4 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/375a555c99b2
status-firefox25: affected → fixed
Whiteboard: [don't uplift until bug 906030 is resolved]
(Reporter)

Comment 13

4 years ago
Verified as fixed on:
Device: LG Nexus 4 (Android 4.2.2)
Build: Firefox 25 Beta 8 / Aurora 26.0a2 (2013-10-16)
Status: RESOLVED → VERIFIED
status-firefox25: fixed → verified
status-firefox26: fixed → verified
You need to log in before you can comment on or make changes to this bug.