Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The v5 release can't discover or communicate with devices, under Fedora 26 #6

Closed
ferdnyc opened this issue Nov 20, 2017 · 21 comments
Closed
Labels
bug An issue that is confirmed as a bug

Comments

@ferdnyc
Copy link
Member

ferdnyc commented Nov 20, 2017

I tried running the v5 release under Fedora 26 (gnome-shell 3.24.3) and got no love at all. Other devices never showed up in the preferences interface, and my PC never appeared in the KDE Connect app on Android. Downgrading to v3 made everything happy. (I don't know why I went to v3, skipping v4 — I think because the release notes indicated it was specifically written to be compatible with Gnome 3.24.)

Under v5, and with debugging on, a number of errors are logged to the user journal, all centering around issues with this.identity in daemon.js:

Nov 20 01:41:50 teevey gjs[26674]: JS LOG: UdpListener: using port 1716
Nov 20 01:41:50 teevey gjs[26674]: JS LOG: TcpListener: using port 1716
Nov 20 01:41:51 teevey gnome-shell[1634]: [gsconnect@andyholmes.github.io]: extension.SystemIndicator._serviceAppeared()
Nov 20 01:41:59 teevey gjs[26674]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 121]: reference to undefined property this.identity
Nov 20 01:41:59 teevey gjs[26674]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<.name@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:121:9
                                   _handlePropertyGet@resource:///org/gnome/gjs/modules/overrides/Gio.js:310:9
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:334:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:649:2
Nov 20 01:41:59 teevey gjs[26674]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 132]: reference to undefined property this.identity
Nov 20 01:41:59 teevey gjs[26674]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<.type@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:132:9
                                   _handlePropertyGet@resource:///org/gnome/gjs/modules/overrides/Gio.js:310:9
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:334:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:649:2
Nov 20 01:42:00 teevey gnome-shell-ext[26781]: JS LOG: [gsconnect@andyholmes.github.io]: PrefsWidget._serviceAppeared()
Nov 20 01:42:00 teevey gjs[26674]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 191]: reference to undefined property this.identity
Nov 20 01:42:00 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
Nov 20 01:42:00 teevey gjs[26674]: JS ERROR: TypeError: packet is undefined
                                   UdpListener<.send@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/protocol.js:213:1
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.broadcast@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:191:9
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:109:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:649:2
Nov 20 01:42:03 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
Nov 20 01:42:03 teevey gjs[26674]: JS ERROR: TypeError: packet is undefined
                                   UdpListener<.send@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/protocol.js:213:1
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.broadcast@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:191:9
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:109:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:649:2
Nov 20 01:42:04 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
Nov 20 01:42:04 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
Nov 20 01:42:04 teevey gjs[26674]: JS ERROR: TypeError: packet is undefined
                                   UdpListener<.send@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/protocol.js:213:1
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.broadcast@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:191:9
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:109:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:649:2
Nov 20 01:42:09 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 20 01:42:09 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(lge)
Nov 20 01:42:09 teevey gjs[26674]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 241]: reference to undefined property this.identity
Nov 20 01:42:09 teevey gjs[26674]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<._addDevice@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:241:1
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.vfunc_startup/<@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:576:17
                                   UdpListener<.receive@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/protocol.js:245:9
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:649:2
Nov 20 01:42:09 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 20 01:42:09 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(lge)
Nov 20 01:42:09 teevey gjs[26674]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<._addDevice@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:241:1
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.vfunc_startup/<@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:576:17
                                   UdpListener<.receive@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/protocol.js:245:9
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:649:2
Nov 20 01:42:09 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 20 01:42:09 teevey gjs[26674]: JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(lge)
Nov 20 01:42:09 teevey gjs[26674]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<._addDevice@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:241:1
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.vfunc_startup/<@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:576:17
                                   UdpListener<.receive@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/protocol.js:245:9
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:649:2

(lge is my LG LS-860 Android phone, which paired just fine once I was running extension v3.)

@andyholmes
Copy link
Collaborator

Hmm, seems like a chicken-egg problem. The identity packet can't be made until the UDP broadcaster binds to a port, but somehow a device packet is being received in the probably milli-seconds span between the UDP listener binding and the identity packet being built. I'm not sure how that could reliably happen.

I've just check v3->v5 and nothing changed that would affect this. It might have just been a bad coincidence or timing fluke.

@andyholmes
Copy link
Collaborator

andyholmes commented Nov 20, 2017

If you don't mind digging in a bit, you could move the line in daemon.js here to just after the UDP inititalization here. That might solve your problem.

Also, I haven't written the debugging page up yet, but you if you turn on "Debug Mode" in the preferences (on the about page) it will kill the daemon and you can run it in a terminal with:

gjs ~/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 

I should say I really haven't written the debug mode to be easy on users, and the preferences dialog doesn't really deal well when you first turn it on since it's connected to the daemon when it gets killed. Normally the preferences dialog will start the daemon and restart it if it stops, but if debug is on it won't. So you should turn on debug, start the daemon in a terminal, then close and reopen the preferences dialog.

@andyholmes andyholmes added the bug An issue that is confirmed as a bug label Nov 20, 2017
@bivalence
Copy link

I'm having the same problem with the same messages on Fedora 26. I'm willing to try and debug, but not sure what you meant when you said: "you could move the line in daemon.js here to just after the UDP inititalization here." I was getting the "this.identity is undefined" error on line 242 of daemon.js. So you are suggesting moving:

if (packet.body.deviceId === this.identity.body.deviceId) { return; }

somewhere after:

    // Listen for new devices
    try {
        this.udpListener = new Protocol.UdpListener();
        this.udpListener.connect("received", (server, packet) => {
            this._addDevice(packet);
        });
    } catch (e) {
        log("Error starting UDP listener: " + e);
        this.vfunc_shutdown();
    }

? I did try that but got some different errors ...

Thanks.

@andyholmes
Copy link
Collaborator

andyholmes commented Nov 21, 2017

I mean move this line from line 605:

this.identity = this._getIdentityPacket();

After the UDP listener is started on line 574, but before it the listener starts adding devices. So it looks like this and should be on line 575:

// Listen for new devices
try {
    this.udpListener = new Protocol.UdpListener();
    this.identity = this._getIdentityPacket(); // <-------------
    this.udpListener.connect("received", (server, packet) => {
        this._addDevice(packet);
    });
} catch (e) {
    log("Error starting UDP listener: " + e);
    this.vfunc_shutdown();
}

I've made this change in my local copy without problems, but there's upwards of a hundred other commits along with it. If you're really brave you can try this Zip:

gsconnect@andyholmes.github.io.zip

@andyholmes
Copy link
Collaborator

Actually, probably what would be easier and better is to add this line:

if (!this.identity) { return; }

to the very beginning of the _addDevice() function.

_addDevice: function (packet, channel=null) {
    Common.debug("Daemon._addDevice(" + packet.body.deviceName + ")");

    if (!this.identity) { return; } // <------
    if (packet.body.deviceId === this.identity.body.deviceId) { return; }

Then it will just bail if the identity packet isn't built yet.

@ferdnyc
Copy link
Member Author

ferdnyc commented Nov 21, 2017

I made both changes:

  1. moved this.identity = this._getIdentityPacket(); inside the try {} at daemon.js:573
  2. added if (!this.identity) { return; } to _addDevice())

With... some effect. No success, but at least the logs changed.

Nov 21 07:57:21 teevey gnome-shell-ext[25406]: JS LOG: [gsconnect@andyholmes.github.io]: Prefs: buildPrefsWidget()
Nov 21 07:57:21 teevey gjs[25607]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:103:9
                                   _handlePropertyGet@resource:///org/gnome/gjs/modules/overrides/Gio.js:310:9
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:334:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:650:2
Nov 21 07:57:22 teevey gjs[25607]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<.name@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:121:9
                                   _handlePropertyGet@resource:///org/gnome/gjs/modules/overrides/Gio.js:310:9
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:334:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:650:2
Nov 21 07:57:22 teevey gjs[25607]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<.type@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:132:9
                                   _handlePropertyGet@resource:///org/gnome/gjs/modules/overrides/Gio.js:310:9
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:334:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:650:2
Nov 21 07:57:22 teevey gjs[25607]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 111]: reference to undefined property this.tcpListener
Nov 21 07:57:22 teevey gjs[25607]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:111:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:650:2
Nov 21 07:57:22 teevey gnome-shell-ext[25406]: JS LOG: [gsconnect@andyholmes.github.io]: PrefsWidget._serviceAppeared()
Nov 21 07:57:22 teevey gjs[25607]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:108:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:650:2
Nov 21 07:57:29 teevey gjs[25607]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:108:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:650:2
Nov 21 07:57:30 teevey gjs[25607]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:111:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:650:2

Most significant would seem to be these; notice how this.tcpListener is now the undefined property being referenced.

Nov 21 07:57:22 teevey gjs[25607]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 111]: reference to undefined property this.tcpListener
Nov 21 07:57:22 teevey gjs[25607]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:111:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:650:2

So then I performed a refresh on the Android app's pairing screen, and the extension logged only this:

Nov 21 08:20:54 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:54 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:56 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:56 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:58 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:58 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:59 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:59 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:59 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:20:59 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:21:10 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:21:10 teevey gjs[25607]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()

@ferdnyc
Copy link
Member Author

ferdnyc commented Nov 21, 2017

I've made this change in my local copy without problems, but there's upwards of a hundred other commits along with it. If you're really brave you can try this Zip:

Virtually identical results to my previous comment, after overwrite-unzipping that package and restarting the Shell. (Logs cover launch of the extension preferences window, a local Refresh, and an Android-app Refresh.)

Nov 21 08:24:51 teevey gnome-shell-ext[27376]: JS LOG: [gsconnect@andyholmes.github.io]: Prefs: buildPrefsWidget()
Nov 21 08:24:51 teevey gjs[27268]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 103]: reference to undefined property this.tcpListener
Nov 21 08:24:51 teevey gjs[27268]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:103:9
                                   _handlePropertyGet@resource:///org/gnome/gjs/modules/overrides/Gio.js:310:9
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:334:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:652:2
Nov 21 08:24:51 teevey gjs[27268]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 121]: reference to undefined property this.identity
Nov 21 08:24:51 teevey gjs[27268]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<.name@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:121:9
                                   _handlePropertyGet@resource:///org/gnome/gjs/modules/overrides/Gio.js:310:9
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:334:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:652:2
Nov 21 08:24:51 teevey gjs[27268]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 132]: reference to undefined property this.identity
Nov 21 08:24:51 teevey gjs[27268]: JS ERROR: TypeError: this.identity is undefined
                                   Daemon<.type@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:132:9
                                   _handlePropertyGet@resource:///org/gnome/gjs/modules/overrides/Gio.js:310:9
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:334:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:652:2
Nov 21 08:24:51 teevey gnome-shell-ext[27376]: JS LOG: [gsconnect@andyholmes.github.io]: PrefsWidget._serviceAppeared()
Nov 21 08:24:51 teevey gjs[27268]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 108]: reference to undefined property this.tcpListener
Nov 21 08:24:51 teevey gjs[27268]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:108:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:652:2
Nov 21 08:25:03 teevey gjs[27268]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.discovering@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:108:13
                                   _handlePropertySet@resource:///org/gnome/gjs/modules/overrides/Gio.js:318:27
                                   _wrapJSObject/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:337:16
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:652:2
Nov 21 08:25:07 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:07 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:08 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:08 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:08 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:08 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:08 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:08 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:08 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:08 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:11 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 08:25:11 teevey gjs[27268]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()

@andyholmes
Copy link
Collaborator

In this case I would only add the line to _addDevice() but leave the call to this._getIdentityPacket() where it is after the tcpListener and udpListener have been added. I've pushed that to git, here's built zip:

gsconnect@andyholmes.github.io.zip

I'm at a loss as to why this is only being reported on Fedora 26, there shouldn't be any incompatibilities with Gnome Shell 3.24 and I don't use any new features from GJS 1.50.

@ferdnyc
Copy link
Member Author

ferdnyc commented Nov 21, 2017

Ooh, I missed some from higher up in the initialization. Note that I'm no longer seeing TcpListener: using port 1716 at all. But I am seeing (running the code from the first ZIP you provided here)...

Nov 21 08:24:30 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: initializing extension
Nov 21 08:24:30 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: enabling extension
Nov 21 08:24:30 teevey dbus-daemon[1371]: [session uid=1000 pid=1371] Activating service name='org.gnome.Shell.Extensions.GSConnect' requested by ':1.26567' (uid=1000 pid=16403 comm="/usr/bin/gnome-shell " label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023")
Nov 21 08:24:30 teevey dbus-daemon[1371]: [session uid=1000 pid=1371] Successfully activated service 'org.gnome.Shell.Extensions.GSConnect'
Nov 21 08:24:30 teevey gjs[27268]: JS LOG: UdpListener: using port 1716
Nov 21 08:24:30 teevey gjs[27268]: JS LOG: Error starting UDP listener: Error: Unsupported type void, deriving from fundamental void
Nov 21 08:24:30 teevey gjs[27268]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 639]: reference to undefined property this.tcpListener
Nov 21 08:24:30 teevey gjs[27268]: JS ERROR: TypeError: this.tcpListener is undefined
                                   Daemon<.vfunc_shutdown@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:639:9
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<.vfunc_startup@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:584:13
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   Daemon<._init@/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:90:9
                                   wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                   @/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js:652:2

@andyholmes
Copy link
Collaborator

That error seems like it might be a regression of a bug that's come up a couple times in the past with regard to GJS. Here's an old bug from 2012, but I bet it's the same cause:

Bug 840414 - gobject-introspection in rawhide ignores LD_LIBRARY_PATH at runtime

This is a little bit out of my league, so I'm not sure I can fix it on my end. But you said v3 runs fine? There must be something I'm missing.

@andyholmes
Copy link
Collaborator

Could you check what version of gjs and gobject-introspection are installed? I've been doing some digging and this seems to be a introspection issue that affects GJS more than most, probably due to the way it maps types from C -> Javascript.

@ferdnyc
Copy link
Member Author

ferdnyc commented Nov 21, 2017

Versions are

% rpm -q gjs gobject-introspection
gjs-1.48.7-1.fc26.x86_64
gobject-introspection-1.52.1-1.fc26.x86_64

v3 runs fine and is fully functional, yes. I looked at the diff of daemon.js between v3 and v5, and the really shocking thing is how little of import has changed, that could be causing this bug. Most of the changes are in the plugins.

I thought the issue might be a difference in the Gio or DBus semantics betwen Gnome 3.24 and 3.26 that v5 relied on, but the changes to client.js are even more minimal, and the changes to service/protocol.js amount to:

--- a/src/service/protocol.js
+++ b/src/service/protocol.js
@@ -258,7 +258,7 @@ var UdpListener = new Lang.Class({
         
         try {
             if (this.socket !== null) {
-                this.socket.close(null);
+                this.socket.close();
             }
         } catch (e) {
             log("error closing UDP listener: " + e);
@@ -502,7 +502,7 @@ var LanChannel = new Lang.Class({
         
         try {
             if (this._listener) {
-                this._listener.close(null);
+                this._listener.close();
             }
         } catch (e) {
             log("error closing listener: " + e);

full stop. (Just for s&g, I reverted that change. No difference, as expected.) It feels like it could perhaps be some sort of esoteric JavaScript parsing/scoping bug, but as far as what change between v3 and v5 could be the trigger... ¯\_(ツ)_/¯

@ferdnyc
Copy link
Member Author

ferdnyc commented Nov 21, 2017

(TBH I'm almost at the point of just saying, "Frell it, I'll upgrade the machine to F27" and calling that the 'fix'. The only reason I've been dragging my feet is some chatter indicating Shell/Mutter may be leaking like a sieve in 3.26, so I was kinda letting that play out first. ...Plus, of course, it would be nice in general to have the GSConnect extension working under F26.)

@andyholmes
Copy link
Collaborator

The only other thing I can think of is the import of Gvc in sound.js since that's a bit of hack, although it would be bummer if I couldn't use that. Could you give this a quick test?

gsconnect@andyholmes.github.io.zip

@ferdnyc
Copy link
Member Author

ferdnyc commented Nov 22, 2017

Holy crap!
screenshot from 2017-11-21 20-11-56
screenshot from 2017-11-21 20-12-04

Nov 21 20:09:51 teevey gnome-shell-ext[27682]: JS LOG: [gsconnect@andyholmes.github.io]: initializing extension preferences
Nov 21 20:09:51 teevey gnome-shell-ext[27682]: JS LOG: [gsconnect@andyholmes.github.io]: Prefs: buildPrefsWidget()
Nov 21 20:09:51 teevey dbus-daemon[1371]: [session uid=1000 pid=1371] Activating service name='org.gnome.Shell.Extensions.GSConnect' requested by ':1.26681' (uid=1000 pid=27682 comm="gnome-shell-extension-prefs gsconnect@an
Nov 21 20:09:51 teevey dbus-daemon[1371]: [session uid=1000 pid=1371] Successfully activated service 'org.gnome.Shell.Extensions.GSConnect'
Nov 21 20:09:51 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.SystemIndicator._serviceAppeared()
Nov 21 20:09:51 teevey gnome-shell-ext[27682]: JS LOG: [gsconnect@andyholmes.github.io]: PrefsWidget._serviceAppeared()
Nov 21 20:09:51 teevey gjs[27697]: JS LOG: UdpListener: using port 1716
Nov 21 20:09:51 teevey gjs[27697]: JS LOG: TcpListener: using port 1716
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(1721510ddb98f20f)
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: Connecting to '1721510ddb98f20f'
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(d0da371c6a82b0b2)
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: Connecting to 'd0da371c6a82b0b2'
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: 2 devices loaded from cache
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.send()
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(teevey)
Nov 21 20:09:52 teevey gjs[27697]: JS WARNING: [/home/ferd/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js 243]: reference to undefined property packet.body.deviceId
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(teevey)
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: UdpListener.receive()
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: Daemon._addDevice(teevey)
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.SystemIndicator._deviceAdded(/org/gnome/Shell/Extensions/GSConnect/Device/1721510ddb98f20f)
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: BatteryIcon._batteryChanged()
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.DeviceMenu._sync()
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.DeviceIndicator._sync()
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: BatteryIcon._batteryChanged()
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.DeviceMenu._sync()
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: Device.activate(1721510ddb98f20f)
Nov 21 20:09:52 teevey gjs[27697]: JS LOG: [gsconnect@andyholmes.github.io]: device already active
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.SystemIndicator._deviceAdded(/org/gnome/Shell/Extensions/GSConnect/Device/d0da371c6a82b0b2)
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: BatteryIcon._batteryChanged()
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.DeviceMenu._sync()
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.DeviceIndicator._sync()
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: BatteryIcon._batteryChanged()
Nov 21 20:09:52 teevey gnome-shell[16403]: [gsconnect@andyholmes.github.io]: extension.DeviceMenu._sync()

@andyholmes
Copy link
Collaborator

That's good, but too bad I have to write my way around Gvc :/ Telephony won't work in that build, but I'll post one here that should after dinner.

@andyholmes
Copy link
Collaborator

andyholmes commented Nov 22, 2017

Here you go, this should work until v6 where I can investigate this more:

gsconnect@andyholmes.github.io.zip

Sorry, this one instead:

gsconnect@andyholmes.github.io.zip

@bivalence
Copy link

Thanks, Andy. I had gone back to v3 yesterday, which had worked for me. But reinstalled with the new level and that's also working for me.

@andyholmes
Copy link
Collaborator

Glad to hear it, it's just too bad you don't get the benefits of Gvc since it does fancy things like roll down the volume when your phone rings. I'll keep investigating, maybe I can get it to work later.

@ferdnyc
Copy link
Member Author

ferdnyc commented Nov 22, 2017

Just confirming, the latest zipfile posted does indeed work under F26, Telephony included (sans Gvc features). I had the world's most boring SMS conversation with myself last night, right on my Shell desktop.

@andyholmes
Copy link
Collaborator

@ferdnyc Glad to hear it. Heh, I have about a 300 message conversation of "test" with myself in my phone ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that is confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants