After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654898 - ("Argument 'str2' (type utf8) may not be null") in network.js
("Argument 'str2' (type utf8) may not be null") in network.js
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
3.1.x
Other Linux
: Normal minor
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 655907 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-07-19 09:57 UTC by Maciej (Matthew) Piechotka
Modified: 2011-08-16 17:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
network: ignore APs that hide their SSID (1.85 KB, patch)
2011-08-03 17:40 UTC, Rui Matos
committed Details | Review
network: always coerce the SSID to _something_ (1.88 KB, patch)
2011-08-03 18:43 UTC, Rui Matos
none Details | Review
network: always coerce the SSID to _something_ (1.88 KB, patch)
2011-08-10 22:47 UTC, Rui Matos
committed Details | Review
Revert "network: ignore APs that hide their SSID" (2.04 KB, patch)
2011-08-14 23:44 UTC, Rui Matos
committed Details | Review

Description Maciej (Matthew) Piechotka 2011-07-19 09:57:04 UTC
Shell display error messages on console:

    JS ERROR: !!!   Exception was: Error: Argument 'str2' (type utf8) may not be null
    JS ERROR: !!!     lineNumber = '0'
    JS ERROR: !!!     fileName = 'gjs_throw'
    JS ERROR: !!!     stack = '("Argument 'str2' (type utf8) may not be null")@gjs_throw:0
([object Object],[object Object])@/usr/share/gnome-shell/js/ui/status/network.js:1168
([object _private_NMClient_DeviceWifi],[object _private_NMClient_AccessPoint])@/usr/share/gnome-shell/js/ui/status/network.js:1248
([object _private_NMClient_DeviceWifi],[object _private_NMClient_AccessPoint])@/usr/share/gjs-1.0/lang.js:110
'

I haven't notice any ill effect but I guess they should be not thrown.
Comment 1 Dan Winship 2011-07-19 12:35:30 UTC
The "expected 4 got 3" error is because you need a newer version of gjs (and possibly glib and gobject-introspection).

The stack trace you quoted is entirely unrelated, but is also an error.
Comment 2 Rui Matos 2011-08-03 17:39:39 UTC
*** Bug 655907 has been marked as a duplicate of this bug. ***
Comment 3 Rui Matos 2011-08-03 17:40:09 UTC
Created attachment 193195 [details] [review]
network: ignore APs that hide their SSID
Comment 4 Rui Matos 2011-08-03 17:47:44 UTC
(In reply to comment #3)
> Created an attachment (id=193195) [details] [review]
> network: ignore APs that hide their SSID

So, this patch in incomplete. I read through nm-applet's code and found the following in applet-device-wifi.c:get_menu_item_for_ap()

	/* Don't add BSSs that hide their SSID or are blacklisted */
	ssid = nm_access_point_get_ssid (ap);
	if (   !ssid
	    || nm_utils_is_empty_ssid (ssid->data, ssid->len)
	    || is_blacklisted_ssid (ssid))
		return NULL;

I'm only doing the equivalent first check here. The 3rd check can easily be copied from nm-applet as the blacklist is quite simple:

static const char *blacklisted_ssids[] = {
	/* http://www.npr.org/templates/story/story.php?storyId=130451369 */
	"Free Public WiFi",
	NULL
};

The 2nd check could be done by either a) doing a wrapper in shell or b) exporting a bindable function in libnm-util and start depending on it.
Comment 5 Rui Matos 2011-08-03 18:43:24 UTC
Created attachment 193198 [details] [review]
network: always coerce the SSID to _something_

--

It seems we can't win even with the previous patch. nm-applet also does
something like this...
Comment 6 Rui Matos 2011-08-10 22:47:23 UTC
Created attachment 193604 [details] [review]
network: always coerce the SSID to _something_

--
- forgot to delete an if statement
Comment 7 Rui Matos 2011-08-12 16:42:11 UTC
Attachment 193195 [details] pushed as 6a3130e - network: ignore APs that hide their SSID
Attachment 193604 [details] pushed as 60b54c0 - network: always coerce the SSID to _something_
Comment 8 Giovanni Campagna 2011-08-14 07:57:38 UTC
(In reply to comment #3)
> Created an attachment (id=193195) [details] [review]
> network: ignore APs that hide their SSID

This patch is wrong. It works in nm-applet, because it creates the menu on the fly, but in gnome-shell, which keeps the menu updated at all times, it will hide those APs forever, even after you connect to them. See discussion on bug 646454.
Comment 9 Rui Matos 2011-08-14 23:44:42 UTC
Created attachment 193833 [details] [review]
Revert "network: ignore APs that hide their SSID"

This reverts commit 6a3130e25fb8a9d83688f29346c187314d1c5745.

This was wrong as it would hide those APs forever, even after connecting to
them, which users can do via other means.

--

Thanks for spotting Giovanni. The other patch is enough to have this
specific bug fixed anyway.

Ok to push the revert?
Comment 10 Giovanni Campagna 2011-08-15 17:24:25 UTC
(In reply to comment #9)
> Created an attachment (id=193833) [details] [review]
> Revert "network: ignore APs that hide their SSID"
> 
> This reverts commit 6a3130e25fb8a9d83688f29346c187314d1c5745.
> 
> This was wrong as it would hide those APs forever, even after connecting to
> them, which users can do via other means.
> 
> --
> 
> Thanks for spotting Giovanni. The other patch is enough to have this
> specific bug fixed anyway.
> 
> Ok to push the revert?

I think so, yes.
Comment 11 Rui Matos 2011-08-16 17:43:11 UTC
Attachment 193833 [details] pushed as ef87729 - Revert "network: ignore APs that hide their SSID"