[Wi-Fi] "undefined" sometimes showed to Wi-Fi MAC address value of Settings

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: leo.bugzilla.gecko, Assigned: vchang)

Tracking

unspecified
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(blocking-b2g:-, b2g18+)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
"undefined" sometimes showed to Wi-Fi MAC address of Settings after the following reproduce sequence.

1. Wi-Fi disable
2. Phone Power off and on
3. Wi-Fi enable in the Settings > Wi-Fi pannel
4. check Wi-Fi MAC address in the Settings > Wi-Fi > Manage networks

I think DOMWifiManager.js should update mac address value after Wi-Fi is enabled.
Keywords: qawanted
fwiw, the bug here is that if a DOMWifiManager is created and wifi is disabled (and was never enabled since startup) we never update its mac address when wifi is turned on. We can probably just send the mac address in the wifiUp message manager message.
(Assignee)

Updated

6 years ago
Assignee: nobody → vchang
Wi-Fi setting does not contain the Mac Address.  It contains the IP address, and the IP address will be undefined if it doesn't get an IP Address from the DHCP server.

The Mac Address is located in the Device information -> More Information section.  This bug is invalid.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Keywords: qawanted
Resolution: --- → INVALID
Naoki, can you please try the steps in comment 0 but check for the mac address in the proper place? Turning on wifi should update the MAC address in the existing settings instance. Right now, you have to close settings and restart it before you see the mac address.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---

Comment 4

6 years ago
Tracking (assuming this is reproducible) but not blocking, given minimal user impact.
blocking-b2g: leo? → -
tracking-b2g18: --- → +
(Assignee)

Comment 5

6 years ago
Created attachment 725451 [details] [diff] [review]
Possible fix, patch v1.0
Attachment #725451 - Flags: review?(mrbkap)
Comment on attachment 725451 [details] [diff] [review]
Possible fix, patch v1.0

My only thought is that it might be worth it to store the mac address somewhere after the first time we get it and avoid calling getMacAddress every time we restart wifi. It probably isn't worth it, though. r=me either way.
Attachment #725451 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 8

6 years ago
I received a Regression e-mail after push the patch to inbound. Should I do something about it ? 

Regression: Mozilla-Inbound-Non-PGO - Dromaeo (DOM) - XP - 2.97% decrease
-------------------------------------------------------------------------
    Previous: avg 380.366 stddev 4.082 of 30 runs up to revision 4f9a36fafdfd
    New     : avg 369.083 stddev 2.172 of 5 runs since revision 9fbbb2fc5dbb
    Change  : -11.283 (2.97% / z=2.764)
    Graph   : http://mzl.la/Y9BM6A

Changeset range: http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=4f9a36fafdfd&tochange=9fbbb2fc5dbb

Changesets:
  * http://hg.mozilla.org/integration/mozilla-inbound/rev/9fbbb2fc5dbb
    : Vincent Chang <vchang@mozilla.com> - Bug 845211 - [Wi-Fi] "undefined" sometimes showed to Wi-Fi MAC address value of Settings. r=mrbkap
    : http://bugzilla.mozilla.org/show_bug.cgi?id=845211
https://hg.mozilla.org/mozilla-central/rev/9fbbb2fc5dbb
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
Should the wifiManager.macAddress return the string "undefined", instead of undefined (the obj), when the macAddress is not available?

This is exactly what I get at https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/connectivity.js#L115 while debugging the STR for bug 880617, which breaks checks like "(wifiManager.macAddress != undefined)".
Flags: needinfo?(vchang)
(Assignee)

Comment 11

5 years ago
(In reply to Mihai Cirlanaru [:mihai][:mcirlanaru] (AFK until June 22) from comment #10)
> Should the wifiManager.macAddress return the string "undefined", instead of
> undefined (the obj), when the macAddress is not available?
> 
> This is exactly what I get at
> https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/
> connectivity.js#L115 while debugging the STR for bug 880617, which breaks
> checks like "(wifiManager.macAddress != undefined)".

I think you can use "if (!wifiManager.macAddress)" to check it, right ?
Flags: needinfo?(vchang)
(In reply to Vincent Chang[:vchang] from comment #11)
> (In reply to Mihai Cirlanaru [:mihai][:mcirlanaru] (AFK until June 22) from
> comment #10)
> > Should the wifiManager.macAddress return the string "undefined", instead of
> > undefined (the obj), when the macAddress is not available?
> > 
> > This is exactly what I get at
> > https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/
> > connectivity.js#L115 while debugging the STR for bug 880617, which breaks
> > checks like "(wifiManager.macAddress != undefined)".
> 
> I think you can use "if (!wifiManager.macAddress)" to check it, right ?

That would not work to check if wifiManager.macAddress is undefined since !"undefined" is false. I think that macAddress is not set properly when it's not available and ends up being a string with the value "undefined".
(In reply to Mihai Cirlanaru [:mihai][:mcirlanaru] from comment #12)
> That would not work to check if wifiManager.macAddress is undefined since
> !"undefined" is false. I think that macAddress is not set properly when it's
> not available and ends up being a string with the value "undefined".

wifiManager.macAddress should definitely be the value undefined, not the string "undefined". Can you file that bug? It should (hopefully) be a simple fix.
Filed bug 888227 to highlight this issue.
You need to log in before you can comment on or make changes to this bug.