If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[FTE][Text Selection] 'Join' button is greyed out, not selectable after Pasting a password into a WiFi password field in the FTU

RESOLVED FIXED

Status

Firefox OS
Gaia::First Time Experience
RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: Marty, Assigned: Aron Barreira Bordin, Mentored)

Tracking

({papercut})

unspecified
ARM
Gonk (Firefox OS)
papercut

Firefox Tracking Flags

(b2g-v2.2 affected, b2g-master verified)

Details

(Whiteboard: [3.0-Daily-Testing][systemsfe], URL)

Attachments

(3 attachments)

(Reporter)

Description

3 years ago
Created attachment 8594205 [details]
logcat-FTU-paste-password.txt

Description:
If the user pastes a WiFi password in the FTU, the 'Join' button will remain greyed out, and not be selectable, so the user must delete and retype some of the password to properly connect.

This does not occur when joining a WiFi network in the Settings app.  Pasting a password enables  the 'OK' button properly.

Repro Steps:
1) Update a Flame to 20150417010203
2) In the FTU use text selection to copy a WiFi password
3) Navigate to the WiFi page and select a WiFi network
4) Long Press the password text field and select the Paste option

Actual:
The 'Join' button will remain greyed out and not be selectable

Expected:
The 'Join' button highlights and is properly selectable

Environmental Variables:
Device: Flame 3.0 (319MB)(Full Flash)
Build ID: 20150417010203
Gaia: 3cd0a9facce26c2acc7be3755a17131a6358e33f
Gecko: 51e3cb11a258
Gonk: b83fc73de7b64594cd74b33e498bf08332b5d87b
Version: 40.0a1 (3.0)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:40.0) Gecko/40.0 Firefox/40.0

Repro frequency: 5/5
See attached: Logcat, Video (URL)
(Reporter)

Comment 1

3 years ago
This issue DOES occur on Flame 2.2 builds
The 'Join' button will remain greyed out and not be selectable after pasting a password

Environmental Variables:
Device: Flame 2.2
Build ID: 20150417002504
Gaia: d50b8a3919a7b4d8d289f150d3b9bed704ebafa9
Gecko: 5ebf32030512
Gonk: ebad7da532429a6f5efadc00bf6ad8a41288a429
Version: 37.0 (2.2)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(pbylenga)
Looks like we only listen for keyup events to enable/disable this join button: https://github.com/mozilla-b2g/gaia/blob/master/apps/ftu/js/wifi.js#L259

Should be an easy fix to listen for paste also (and test for the same). I'm not sure how a user would get a password on the clipboard though in the first-time use, so I dont think we can block on this.
Keywords: papercut
Whiteboard: [3.0-Daily-Testing] → [3.0-Daily-Testing][systemsfe]
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(pbylenga)
See comment #2, the fix here involves adding event listener(s) for cut/paste to also validate the password and toggle the join button. To develop and test your solution, you can start the FTU app from the WebIDE, or the 'Launch First Time Use' button in Settings > Developer. You will probably want to follow the instructions for debugging certified apps: https://developer.mozilla.org/en-US/Firefox_OS/Using_the_App_Manager#Debugging_Certified_Apps

I would also prefer a new test to ensure this doesnt regress, I'm happy to walk through how/where to do that if you are interested in taking this bug.
Mentor: sfoster@mozilla.com
(Assignee)

Comment 4

3 years ago
Hi Sam!

I'd like to be assigned to work with this bug. 
I never wrote a gaia test, I'll try to read some tests to learn about it, but maybe I can need your help to write a new one to this bug.
Hi Aron, I've assigned you, have at it. 
 
For the unit test, you'll be adding to https://github.com/mozilla-b2g/gaia/blob/master/apps/ftu/test/unit/wifi_test.js, 

You can read about unit testing Gaia at https://developer.mozilla.org/en-US/Firefox_OS/Automated_testing/Gaia_unit_tests, the tldr; is in your gaia checkout directory, do $ npm install, then ./bin/gaia-test to bring up the full suite in a browser window. If you then touch wifi_test.js it will run just the tests/suites in that file. We just need a couple of assertions that verify that a (fake) paste event triggers the input validation properly. It should fail without your patch, and pass with it. If you could backfill and add tests for the other events that would be great - automated testing coverage for the FTU app is thin and its a constant game of catch-up. 

I'm in the #gaia and #systemsfe channels on the irc.mozilla.org network US/Pacific time, or feel free to reach me directly by email. When your patch is ready, or if want input, submit a pull request to the gaia repo on https://github.com/mozilla-b2g/gaia, with the form 'Bug 1155888 - {short summary}'
Assignee: nobody → aron.bordin
Aron, do you have a device with Firefox OS on that you can test with? The simulator isnt able to scan for wifi networks, so it might be difficult to work on this bug without an actual phone to run your code on. My bad for not thinking of that earlier.
Flags: needinfo?(aron.bordin)
(Assignee)

Comment 7

3 years ago
Hi Sam!

Yes, I have a flame device. I'll be working is this bug asap. 

Thx!
Flags: needinfo?(aron.bordin)

Comment 8

3 years ago
Created attachment 8596929 [details] [review]
[gaia] aron-bordin:paste_wifi_pass_ftu > mozilla-b2g:master
(Assignee)

Comment 9

3 years ago
Comment on attachment 8596929 [details] [review]
[gaia] aron-bordin:paste_wifi_pass_ftu > mozilla-b2g:master

Hi!

Please, take a look in this PR when possible. 
To fix the bug I just replaced keyup with input event, this same event is being used in the wifi settings. It's working now.

I also created 3 tests, WEP, WPA-PSK and WPA-EAP.

Let me know if I need to fix or edit something.

Thx!
Attachment #8596929 - Flags: review?(sfoster)
Comment on attachment 8596929 [details] [review]
[gaia] aron-bordin:paste_wifi_pass_ftu > mozilla-b2g:master

The patch works great, listening for 'input' is a much better solution than handling each individually. For the unit tests, the test for each of WEP, WPA-EAP and WPA-PSK isn't adding much value here - the WifiHelper itself isnt under test here and the 3 tests dont tell us anything new after the first one. From the point of view of the FTU WifiManager, we could just stub the WifiHelper.isValidInput and ensure it gets called when we dispatch the 'input' event, and that the disabled state of that button properly reflects the return value. We cant effectively test 'paste'/'cut' events in a unit test, but that's fine - we can trust the platform will produce an input event for those. 

I'll cancel review for now, please re-flag me when you've updated the PR.

I've opened bug 1158351 for adding missing unit tests for WifiHelper.isValidInput where they belong.
Attachment #8596929 - Flags: review?(sfoster)
(Assignee)

Comment 11

3 years ago
Comment on attachment 8596929 [details] [review]
[gaia] aron-bordin:paste_wifi_pass_ftu > mozilla-b2g:master

Hi Sam,

Please take a look in my updated PR.

Thx :)
Attachment #8596929 - Flags: review?(sfoster)
Comment on attachment 8596929 [details] [review]
[gaia] aron-bordin:paste_wifi_pass_ftu > mozilla-b2g:master

Looks great, thanks for doing this.
Attachment #8596929 - Flags: review?(sfoster) → review+

Updated

3 years ago
Keywords: checkin-needed

Updated

3 years ago
Keywords: checkin-needed
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Updated

3 years ago
Keywords: checkin-needed

Comment 13

3 years ago
http://docs.taskcluster.net/tools/task-graph-inspector/#a5eZKjJcT4uKZsjph2UB_Q

The pull request failed to pass integration tests. It could not be landed, please try again.
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Updated

3 years ago
Keywords: checkin-needed

Comment 14

3 years ago
Pull request has landed in master: https://github.com/mozilla-b2g/gaia/commit/8b409487f6cdad5bafb0d1a17cac1986fd7406ee

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED

Updated

2 years ago
status-b2g-master: affected → fixed
Created attachment 8612217 [details]
v3.0.mp4

This bug has been verified as Pass on latest build of Flame v3.0 & Nexus 5 v3.0 by the STR in Comment 0. 

Results:
'Join' button is selectable after pasting a password into a WiFi password field in the FTU.

See attachment: v3.0.mp4
Reproduce rate: 0/15

Device: Flame v3.0(Pass)
Build ID               20150527160204
Gaia Revision          05380df3158fa39e1dde1687c0bf11a71f8c6868
Gaia Date              2015-05-27 06:27:27
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/2c815cc65cc9
Gecko Version          41.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150527.193645
Firmware Date          Wed May 27 19:36:54 EDT 2015
Bootloader             L1TC000118D0


Device: Nexus 5 v3.0(Pass)
Build ID               20150527160204
Gaia Revision          05380df3158fa39e1dde1687c0bf11a71f8c6868
Gaia Date              2015-05-27 06:27:27
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/2c815cc65cc9
Gecko Version          41.0a1
Device Name            hammerhead
Firmware(Release)      5.1
Firmware(Incremental)  eng.cltbld.20150527.193206
Firmware Date          Wed May 27 19:32:20 EDT 2015
Bootloader             HHZ12f
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage+] [MGSEI-Triage+]
status-b2g-master: fixed → verified
You need to log in before you can comment on or make changes to this bug.