Closed Bug 825017 Opened 9 years ago Closed 9 years ago

[B2G][FTE] The import Facebook contacts button during the FTU is disabled

Categories

(Firefox OS Graveyard :: Gaia::First Time Experience, defect, P3)

defect

Tracking

(blocking-basecamp:+)

VERIFIED FIXED
B2G C4 (2jan on)
blocking-basecamp +

People

(Reporter: ckreinbring, Assigned: mbudzynski)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
Build ID: 20121128204232

Steps to reproduce:

Unagi version: 20121227070202

1. With a fresh or flashed device, navigate through the FTU options until the "Import Contacts From" page is reached.
2. Observe the status of the Facebook button.
3. Tap the Facebook button and observe the reaction.


Actual results:

The Facebook button is disabled, and tapping it returns no response.


Expected results:

The Facebook button is enabled, and tapping it prompts the user to log in in order to import contacts.
I saw this as well during testing this morning, and I had selected a wifi network and was connected at the time - Chris I am assuming you were connected to wifi when you saw this?  I have previously filed Bug 816646 to address the error messaging portion.
Yes, I was able to connect to WiFi with no problems.
Nominating for triage, since in my case I explictly see wifi connected and Facebook import is greyed out during the first time run of the phone on a freshly flashed 12-27 build.
blocking-basecamp: --- → ?
Triage: BB+, C4, P3 - severe usability issue, regression
blocking-basecamp: ? → +
Keywords: regression
Priority: -- → P3
Target Milestone: --- → B2G C4 (2jan on)
Sorry, but I tried with different builds and latest gaia code from master, and I'm still unable to recreate it. Can anyone please activate DEBUG flag and post here the resulting logcat?

Also, if anybody have time, could you add a console.log around the line 200 of apps/communications/ftu/js/navigation.js to check the state of WifiManager.isConnected and DataMobile.isAvailable

e.g. console.log('wifi?'+WifiManager.isConnected + ' data?'+DataMobile.isDataAvailable);
Attached is the wifi output I got when running the first time setup on yesterday's build (12-27-12). I can see the wifi go from "Associated" to "Connected" in the UI, but the Facebook import is greyed out when you get to that screen. I blocked out the IP address, but there was a valid IP address associated in the last step.
Assignee: nobody → mbudzynski
The problem is that 'onstatuschange' event from LOC 112 wifi.js never fires if we are already connected, thats why 'WifiManager.isConnected' stays undefined. I'm working on a patch now.

:fcampo, FYI, Console output you asked for:

E/GeckoConsole(456): Content JS LOG at app://communications.gaiamobile.org/ftu/js/navigation.js:201 in n_handleEvent: wifi? undefined data? false
Attached file patch
NOTE: If blocking-basecamp+ is set, just land it for now.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: 
Testing completed: 
Risk to taking this patch (and alternatives if risky):
Attachment #696323 - Flags: review?(fernando.campo)
Oddly, when I just downloaded the 12-28 build and ran first time setup, the Facebook import was not greyed out for me.
It will if you'll run it for the second time, and I suppose it could happen on production when we will restart the phone between connecting to wifi & finishing it.
Even if that's the case, the wifi would be going through different states [scanning - associated - connected] and respond to onstatuschange event. Sincerely, no idea why is not working for you. I'm still unable to reproduce it.
:fcampo fixed those bugs you've reported. 

About the states - maybe it happen before ftu is launched? I have no idea, but every time I flash I'm already connected to the wifi so this is the first possible workaround in my mind.
(In reply to Michal Budzynski (:michalbe) from comment #12)
...
> but every time I flash I'm already connected to the wifi so this is the
> first possible workaround in my mind.

when you say 'flash', you mean installing a new image, doing a make install-gaia, or doing a make reset-gaia ?
Both. I'm always connected on startup if I was on the last time, i doesn't matter if I install-gaia or reset-gaia. Only way to forgot the Wifi is to do it explicitly in Settings.
I've experienced the same issue. If you make install-gaia or make reset-gaia FB is not enabled in ftu. However, I've just flashed from scratch (flash.sh unagi) and ftu works as expected, and FB is enabled.

My guess: WiFis are being "remembered" even with make reset-gaia (it's just one of the view settings that are not removed, which is great but in this case it might be annoying). In the case of flashing an image all the settings get (obviously) removed, including WiFi. FB contacts first time experience checks for connectivity, and if it is not available, that option is shaded. It might be a WiFi issue instead of FB's first time experience, or a combination of both. 

Can we completely remove all the settings in the Makefile for make reset-gaia to replicate a real first time experience?
I've updated the patch so now it is disconnecting from the Wifi on startup in case it's somehow connected. I think it's useful eg. when user will not finish FTU and reboot the phone in the middle of it.

:fcampo: could you r? What do you think about this solution?
(In reply to Michal Budzynski (:michalbe) from comment #14)
> Both. I'm always connected on startup if I was on the last time, i doesn't
> matter if I install-gaia or reset-gaia. Only way to forgot the Wifi is to do
> it explicitly in Settings.

The Wi-Fi is connected once you connected to any AP ever, it's remembered in gecko. c.c. Vincent Chang for more information. I don't think this is buggy though...
And I don't think this patch fix anything because after bug 824457 is fixed, the import button seems working fine.

Another thing is why not using window online/offline event change? :) Avoid the user using data connection?
(In reply to Alive Kuo [:alive] from comment #17)
> Another thing is why not using window online/offline event change? :) Avoid
> the user using data connection?

That was also mine first thought, but we decided that it won't fit in here: https://github.com/mozilla-b2g/gaia/pull/7230#discussion-diff-2516551
(In reply to Michal Budzynski (:michalbe) from comment #18)
> (In reply to Alive Kuo [:alive] from comment #17)
> > Another thing is why not using window online/offline event change? :) Avoid
> > the user using data connection?
> 
> That was also mine first thought, but we decided that it won't fit in here:
> https://github.com/mozilla-b2g/gaia/pull/7230#discussion-diff-2516551

Good. But in my view if navigator.onLine doesn't mean we could access network then it's a failed API...
However, you will still encounter the same problem if the Wi-Fi enforces captive portal(a tech that enforces you to login using browser. The web content is replaced by the router. But this is an edge case though...
So what is the status in here? My patch is waiting for 9 days now and unfortunately I reproduce the bug even after patch for bug 824457 landed.
Flags: needinfo?(fernando.campo)
Comment on attachment 696323 [details]
patch

I'll take the review ;)
Attachment #696323 - Flags: review?(fernando.campo) → review?(francisco.jordano)
Sorry for that Michal, I was on PTO till today so didn't have time till now.

So, the patch looks good for me, but alive made some interesting comments, though. 
Forgetting network seems ok to me, as the FTU is a one-time only app, we shouldn't have any previous network remembered, except on the edge case of starting FTU, turn off phone after connecting to a wifi, and turning it on later to finish the FTU process. But even on this case, we should remember only the wifi we connected to when we used ftu last time. 
As I'm not the person who decides the behaviour of the app (just speaking out my mind), I'll try to look for Ayman today as we are all in Berlin to ask him and then decide.
Flags: needinfo?(fernando.campo)
I agree this is just a UX decision. I don't think FTU must be `clean` though..
Done and ready for review.
Comment on attachment 696323 [details]
patch

After speaking with Ayman we agreed on FTU starting from a tabula rasa state, so no wifis remembered. This patch checks if we are connected to any, and if that's the case, disconnect and forget, so cool with me
Attachment #696323 - Flags: review?(francisco.jordano) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Verified fixed in Unagi version 20130116070204.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.