Closed Bug 901903 Opened 6 years ago Closed 6 years ago

The guest profile is created at every startup

Categories

(Firefox for Android :: General, defect)

25 Branch
ARM
Android
defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 26
Tracking Status
firefox25 + verified
firefox26 --- verified
fennec 25+ ---

People

(Reporter: u421692, Assigned: bnicholson)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached file 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.
Assignee: nobody → bnicholson
tracking-fennec: --- → ?
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".
No matter what settings I chose, the tabs are always restored.
Duplicate of this bug: 902991
tracking-fennec: ? → 25+
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
Summary: Session restore does not take into account the session restore settings → The guest profile is created at every startup
Attachment #789183 - Flags: review?(wjohnston)
Attachment #789183 - Flags: review?(wjohnston) → review+
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+
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
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
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?
Depends on: 906030
This broke Guest Mode on mozilla-central, see bug 906030.
Attachment #789196 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Whiteboard: [don't uplift until bug 906030 is resolved]
https://hg.mozilla.org/releases/mozilla-aurora/rev/375a555c99b2
Whiteboard: [don't uplift until bug 906030 is resolved]
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
You need to log in before you can comment on or make changes to this bug.