Closed Bug 845211 Opened 9 years ago Closed 9 years ago

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

Categories

(Firefox OS Graveyard :: Wifi, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:-, b2g18+)

RESOLVED FIXED
blocking-b2g -
Tracking Status
b2g18 + ---

People

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

References

Details

Attachments

(1 file)

"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: 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
Closed: 9 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 → ---
Tracking (assuming this is reproducible) but not blocking, given minimal user impact.
blocking-b2g: leo? → -
tracking-b2g18: --- → +
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+
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
Closed: 9 years ago9 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)
(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.