gnome-github-notifications icon indicating copy to clipboard operation
gnome-github-notifications copied to clipboard

Port libsoup3

Open prahal opened this issue 2 years ago • 13 comments

I am currently on gnome shell 43.0 binded to libsoup3 gir on Debian and it works. It also works on a Debian install with gnome-shell 42.4 binded to libsoup 2.4.

But there are blind spots in the error paths:

  • in:
body = this.httpSession.send_and_read_finish(result, err);
                    if (!body) {
                        error('Body is null: ' + err);

I do not know if the err (a GError) is converted to a string properly on error, I guessed. Also, the 'Body is null' prefix might not be the best.

  • I converted blindly: error('result error: ' + JSON.stringify(response)); to error('result error: ' + JSON.stringify(result)); I do not know what a GAsyncResult stringified will become. The issue is I do not know how it worked before with a SoupMessage.

So it is in a "works for me" form. As those changes are specific to the libsoup3 code paths maybe it could be merged and those issues handled when those code paths are triggered.

prahal avatar Oct 10 '22 21:10 prahal

Both previous issues are fixed. The part about the body is obsolete (I found that gerror are exceptions in javascript, which is at the same time obvious and nowhere documented). And I replaced the JSON.stringify of the result object with two stringify: one of response and the other of the body (that was previously a subfield of response).

prahal avatar Oct 11 '22 23:10 prahal

This would fix #51 right?

dveeden avatar Oct 27 '22 06:10 dveeden

@dveeden yes it fixes #51 thus why there a subcommit to add gnome shell 43 compatibility. Cheers

prahal avatar Oct 29 '22 08:10 prahal

Would love to see this PR merged :) Thanks @prahal

thomasnemer avatar Nov 22 '22 08:11 thomasnemer

Working in Gnome43 (manjaro version) @alexduf could we have this merged please? EDIT: And thanks @prahal to get this working =D

Shelvak avatar Nov 28 '22 14:11 Shelvak

I have been using this as a PKGBUILD for 11 days now, it's has been working flawlessly. I would love to see this merged.

KSXGitHub avatar Dec 07 '22 08:12 KSXGitHub

The only issue is that, if the notifications cannot be grabbed (e.g. the token being invalid, expired or missing, or the device being offline), notifications count will be shown as "0" instead of "!" (i.e. the previous behavior).

BTW, good job! Thanks!

machitgarha avatar Dec 21 '22 11:12 machitgarha

There's also another issue happening here. The notifications count doesn't update at the interval and regularly (e.g. every one minute), but only when I reload the extension or make a login (e.g. after locking the screen). Kinda weird.

machitgarha avatar Dec 30 '22 02:12 machitgarha

There's also another issue happening here. The notifications count doesn't update at the interval and regularly (e.g. every one minute), but only when I reload the extension or make a login (e.g. after locking the screen). Kinda weird.

I noticed the same, many times it took a lot to update (0 => N or N => 0...) I didn't dig into it yet..

Shelvak avatar Dec 31 '22 21:12 Shelvak

@prahal It appears that the current maintainer is no longer active. I believe it would be beneficial to maintain the forked version. Would you be interested in taking on this responsibility?

username0136 avatar Mar 07 '23 05:03 username0136

@git-Hmmm I cannot spend the time to maintain a proper fork (published on extensions.gnome.org). Mainly because currently I invest time in a few other projects. But I could maintain an initial code fork on GitHub with an issue tracker. Maybe later on I could publish the extension with proper metadata for a fork on extensions.gnome.org.

prahal avatar Mar 08 '23 16:03 prahal

@git-Hmmm also note that a maintained fork already exists. https://github.com/mackdk/gnome-github-manager . Maybe it would be better to check if it supports libsoup3 and else port my patch to it than starting a new fork.

prahal avatar Mar 08 '23 16:03 prahal

@prahal Thanks for the info. I will checkout this fork.

username0136 avatar Mar 08 '23 16:03 username0136