Closed Bug 1256583 Opened 4 years ago Closed 3 years ago

Welcome screen is not displayed on first run

Categories

(Firefox for Android :: First Run, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox45 --- unaffected
firefox46 --- unaffected
firefox47 --- unaffected
firefox48 --- unaffected
fennec 48+ ---
firefox50 --- fixed

People

(Reporter: sflorean, Assigned: liuche)

References

(Blocks 1 open bug)

Details

(Keywords: regression, reproducible)

Environment: 
Device: Asus ZenPad 8 (Android 5.0.2);
Build: Nightly 48.0a1 (2016-03-14);

Steps to reproduce:
1. Launch Fennec with a clean profile;

Expected result:
Welcome screen is displayed. 

Actual result:
About:home is displayed.

Notes:
Welcome screen is displayed if Fennec is reopened.
Nick, could enabling the push service somehow have caused this?
tracking-fennec: --- → ?
Flags: needinfo?(nalexander)
I thought I just saw the first run screen appear when testing my own local build today... 

Sorina, what method are you using to launch the app? Tapping the Firefox icon?
tracking-fennec: ? → 48+
Flags: needinfo?(sorina.florean)
First I went to Android settings and cleared the data for the Firefox App, then I taped on the Firefox icon from the app list. In this way Fennec is launched and the welcome screen is not displayed. 
Then if I close the Firefox app from the task manager and I reopen it from the app list the welcome screen is displayed.
Flags: needinfo?(sorina.florean)
(In reply to sorina.florean from comment #4)
> First I went to Android settings and cleared the data for the Firefox App,
> then I taped on the Firefox icon from the app list. In this way Fennec is
> launched and the welcome screen is not displayed. 

Oh, so was Firefox already running before you cleared the app data? We only check to show the first run UI if the app is launching from a killed state, not reopening from hitting the shortcut icon.

> Then if I close the Firefox app from the task manager and I reopen it from
> the app list the welcome screen is displayed.

This confirms my suspicion above, and makes me think there's nothing to do here to fix this bug.

As long as the first run UI appears when a new user first installs the app, we're good.
Launching the app for the first time or launching the app after clearing its data should be the same thing. It should not have different results.
(In reply to sorina.florean from comment #6)
> Launching the app for the first time or launching the app after clearing its
> data should be the same thing. It should not have different results.

Yes, if you ensure the app isn't running before you clear data.

What happens if you close Firefox from the task manager, clear the data, and then re-launch it?
I close Firefox from the task manager, clear the data, re-launch Fennec and welcome screen is not displayed. Then I close and reopen it from app list and welcome screen is displayed.
Chenxia, can you help investigate?
Flags: needinfo?(liuche)
(In reply to sorina.florean from comment #8)
> I close Firefox from the task manager, clear the data, re-launch Fennec and
> welcome screen is not displayed. Then I close and reopen it from app list
> and welcome screen is displayed.

I thought we might be seeing strange interactions with how we handle the MAIN action when the browser is already running, but it's simpler than that: we're checking for first run when we attach to the window: https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java#967.  That's how we wait for Gecko to be ready; but it fails here: if the App is running, we don't get onAttachedToWindow() again.  (I think.)  jchen has a delay-until-Gecko-state thing in GeckoThread; this ticket might use that.

It was my understanding, however, that clearing data killed the Fennec process.  That suggests there's something *else* happening here.  Is it possible clear data isn't killing the process on this device?
Flags: needinfo?(nalexander)
I saw this issue too while debugging distributions recently. A lot of times after clearing app data I did not see the first run tour.

(In reply to Nick Alexander :nalexander from comment #10)
> It was my understanding, however, that clearing data killed the Fennec
> process.

This was my impression too and it would be strange if the app wouldn't be killed (Data randomly disappearing while the code is still running?)

I wonder why we are doing this in onAttachedToWindow(). The comment points to bug 1077583 and the Gecko lifecycle and I wonder if this even applies here? Isn't the first run tour independent from Gecko nowadays? Maybe we can move the code to onCreate() or onResume()?

Additionally checkFirstrun() looks into the Intent data. Maybe some of this data is lost when the activity is re-created after clearing app data?
Blocks: onboarding
Flags: needinfo?(liuche)
I just saw this happen when uninstalling and reinstalling an app on my local build. I was using an emulator, so maybe the slow environment somehow tickled this?
Assignee: nobody → liuche
Do you have steps to consistently reproduce this? I'm having trouble triggering it again.
Flags: needinfo?(sorina.florean)
(In reply to :Margaret Leibovic from comment #13)
> Do you have steps to consistently reproduce this? I'm having trouble
> triggering it again.

Steps to reproduce:
1. Uninstall Fennec;  
2. Install Fennec;
3. Launch Fennec (Welcome screen not displayed);
4. Close Fennec (swipe to close from the recent apps);
5. Launch Fennec (Welcome screen is displayed).
Flags: needinfo?(sorina.florean)
Just poking this bug... is this on your radar?
Flags: needinfo?(liuche)
Yep! This is on my radar, I looked into this briefly before I left - it seems like some SharedPreference is not being cleaned up, but <application android:allowBackup> is false, which means SharedPreferences shouldn't be cached.

I'll run through this again, and try to figure out if we should be doing more during cleanup/uninstall.

Keeping the NI.
So I'm not seeing this anymore - Sorina, are you still able to reproduce this with the latest nightly builds?
Flags: needinfo?(liuche) → needinfo?(sorina.florean)
Tested using:
Device: Asus ZenPad 8 (Android 5.0.2) and Asus Transformer Pad (Android 4.2.1)
Build: Nightly (2016-07-04)

The issue is not reproducible anymore. Welcome screen is displayed after I launch Fennec with a clean profile.
Flags: needinfo?(sorina.florean)
Can you check to make sure it's not still affecting 48?  Even if it works now in nightly, it's 48 that was originally marked as affected, so I'd like to make sure.
Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(sorina.florean)
Resolution: --- → WORKSFORME
Tested on latest Aurora (build from 2016-07-10) with Asus ZenPad 8 (Android 5.0.2) and Prestigio Grace X5 (Android 4.4.2) and Welcome screen is displayed if I launch Fennec with a clean profile.
Flags: needinfo?(sorina.florean)
See Also: → 1295961
You need to log in before you can comment on or make changes to this bug.