gnome-shell-extension-gsconnect icon indicating copy to clipboard operation
gnome-shell-extension-gsconnect copied to clipboard

Use KDE Connect's verification codes

Open strugee opened this issue 2 years ago • 6 comments

Fixes #1091

Still TODO:

  • Diagnose segfaults in the daemon
  • Figure out if the UTF-8 errors are a problem
  • Display verification codes in the notification (right now you need to have the preferences window open)
  • Clean up the style
  • Clean up the .ui file diff that Glade made a mess of
  • Fix the verification code computation so it actually works

Some notes on the segfaults: they seem to happen during the pairing process. I think there's a race condition or something like that during the verification code computation. Most of the time I just get Segmentation fault (core dumped), but occasionally I get a longer assertion error:

GLib:ERROR:../glib/gchecksum.c:1618:g_checksum_update: code should not be reached
Bail out! GLib:ERROR:../glib/gchecksum.c:1618:g_checksum_update: code should not be reached
Aborted (core dumped)

The UTF-8 errors come from the preferences pane and all look like this:

(gsconnect-preferences:335958): Gjs-CRITICAL **: 01:53:39.208: JS ERROR: TypeError: malformed UTF-8 character sequence at offset 0
@/var/home/alex/.local/share/gnome-shell/extensions/[email protected]/gsconnect-preferences:114:21

strugee avatar Jul 29 '21 09:07 strugee

Also, I used Unicode 🔑 instead of an icon because I couldn't find a suitable icon in what Glade said was available. If there's a better way, let me know.

One more thing - this is basically my first time writing anything approaching GTK/GObject/etc. code, so please review with extra scrutiny. I might have broken everything!

strugee avatar Jul 29 '21 09:07 strugee

Diagnose segfaults in the daemon

You can run the daemon with GDB if necessary. Let me know if that's something you want help with and after I can add it to the contributing document.

Figure out if the UTF-8 errors are a problem

These are fine to leave and not related to your PR. It's just a corner-case in GJS and GDBus related to virtual functions.

Display verification codes in the notification (right now you need to have the preferences window open)

I think that the combined verification code is what needs to be shown in the notification, at least I think that's what Android does. I think the older keys are effectively being deprecated.

andyholmes avatar Jul 29 '21 23:07 andyholmes

Closing this as completed, since it was brought home by @daniellandau in #1493 and is now merged. Thanks @strugee !

ferdnyc avatar Oct 24 '22 00:10 ferdnyc

Whoops. Premature close, as there's more to this PR than what went in with #1493. Reopening, and attempting to reconcile with the current main branch HEAD.

ferdnyc avatar Oct 24 '22 00:10 ferdnyc

attempting to reconcile with the current main branch HEAD.

That actually wasn't hard at all, in terms of actual change conflicts. Whether the code on this branch is still compatible with the main source is another matter, which I guess the CI will at least help us determine...

ferdnyc avatar Oct 24 '22 03:10 ferdnyc

Hey, sorry for disappearing - life got in the way :-)

Glad to hear my work was useful for #1493.

strugee avatar Jul 28 '23 01:07 strugee