fthx / new-mail-indicator

New email notification icon for GNOME Shell.
12 stars 1 forks source link

Error: Invalid value 'undefined' for property body in object initializer. #17

Closed St3v3-wq closed 3 months ago

St3v3-wq commented 3 months ago

I just got this error in gnome-extensions and the extension would not start.

fthx commented 3 months ago

You run Arch? I got another similar bug in Proton VPN button extension.

The bug is due to the new notification syntax (needs two args in GS 46) that I did forget to change. BUT that's not the root cause. The cause is the app is not found.

Do you know how to use looking glass in gnome shell?

fthx commented 3 months ago

btw I don't get any error using Ubuntu 24.04.

St3v3-wq commented 3 months ago

No, Fedora 40.

fthx commented 3 months ago

What's your email client? Is it set as default email client in GS prefs?

St3v3-wq commented 3 months ago

What's your email client? Evolution (RPM) Is it set as default email client in GS prefs? Yes

This is strange: I installed claws-mail, then the extension is working. But only with claws, even when evolution is set in GS. When I remove claws, the error is something like "failed to open claws-mail, failure in PATH".

fthx commented 3 months ago

Ok. Maybe a session restart is needed for email client switch.

Please in GNOME Shell:

St3v3-wq commented 3 months ago

Screenshot from 2024-07-15 12-21-25 I'm sorry, lg is unsupported. Is there a new version somewhere? Also when I install it anyway..

fthx commented 3 months ago

LG is not an extension, it's built-in I've installed a F40 vm and the result is a void name, so the error.

fthx commented 3 months ago

image

fthx commented 3 months ago

Damn Software app, soooo slow. I'm back soon ;-)

fthx commented 3 months ago

Ok I installed Evolution, will be better now ;-)

fthx commented 3 months ago

Mmmh I get all attended prompts? image

St3v3-wq commented 3 months ago

Ok, here the output from lg: ...true,org.Evolution.desktop...

fthx commented 3 months ago

It works in my VM:

image

fthx commented 3 months ago

The button click works too.

St3v3-wq commented 3 months ago

hmm?

fthx commented 3 months ago

Did you set this (again)?

image

St3v3-wq commented 3 months ago

Screenshot from 2024-07-15 12-42-05 Screenshot from 2024-07-15 12-41-23 Screenshot from 2024-07-15 12-40-46

St3v3-wq commented 3 months ago

It does not even start without claws-mail??

fthx commented 3 months ago

Did you try without any other extension disabled?

fthx commented 3 months ago

What's the command in terminal to update rpm packages, please?

St3v3-wq commented 3 months ago

sudo dnf update

St3v3-wq commented 3 months ago

Maybe this is a "only my computer" problem. Sorry. Should I delete some Gnome Settings?

fthx commented 3 months ago

I cannot install Claws, it's failing...

fthx commented 3 months ago

Do you have the black square in LG at the end of org.Ev... ? (That's attended.)

fthx commented 3 months ago

Could you change this line in: ~/.local/share/gnome-shell/extensions/new-mail-indicator/extensions.js ?

48 Main.notify("New Mail Indicator: error, no email client found");

to:

Main.notify("New Mail Indicator: error, no email client found", "");

fthx commented 3 months ago

Then restart your session.

St3v3-wq commented 3 months ago

Do you have the black square in LG at the end of org.Ev... ? (That's attended.)

Yes, it's white here.

St3v3-wq commented 3 months ago

Yep, it's running now (error, no email client found).

fthx commented 3 months ago

Well that's annoying I cannot reproduce the root cause in VM. Maybe an update since F40 iso has changed something?

St3v3-wq commented 3 months ago

It was running with Evolution from Flatpak, but not anymore. That is strange.

fthx commented 3 months ago

As a workaround you can change this:

_find_default_client() {
    this._decoder = new TextDecoder();
    this._app_query = GLib.spawn_command_line_sync("xdg-mime query default x-scheme-handler/mailto");
    this._app_filename = this._decoder.decode(this._app_query[1].slice(0,-1));
    this._app = Shell.AppSystem.get_default().lookup_app(this._app_filename);
    if (this._app) {
        this._app_name = this._app.get_name();
    } else {
        Main.notify("New Mail Indicator: error, no email client found");
    }
}

to this:

_find_default_client() {
    this._app_name = "Evolution";
}
fthx commented 3 months ago

but you won't have the click feature since I catch the app object's windows.

fthx commented 3 months ago

in LG did you try:

Shell.AppSystem.get_default().lookup_app("org.gnome.Evolution.desktop")

?

St3v3-wq commented 3 months ago

Ok, thank You for this.

in LG did you try:

Shell.AppSystem.get_default().lookup_app("org.gnome.Evolution.desktop")

?

r(0) = null

St3v3-wq commented 3 months ago

Oh sorry, I forgot to say: There is a bug in the current Evolution installation and there ist no org.gnome.Evolution.desktop. Is this maybe the problem? I mean, there is no Icon to start Evolution.

St3v3-wq commented 3 months ago

As a workaround you can change this:

_find_default_client() {
    this._decoder = new TextDecoder();
    this._app_query = GLib.spawn_command_line_sync("xdg-mime query default x-scheme-handler/mailto");
    this._app_filename = this._decoder.decode(this._app_query[1].slice(0,-1));
    this._app = Shell.AppSystem.get_default().lookup_app(this._app_filename);
    if (this._app) {
        this._app_name = this._app.get_name();
    } else {
        Main.notify("New Mail Indicator: error, no email client found");
    }
}

to this:

_find_default_client() {
    this._app_name = "Evolution";
}

Thank You for that. It's running now, with the error: Error: Invalid value 'undefined' for property body in object initializer.

fthx commented 3 months ago

For Ev install, you have to check in /usr/share/applications

St3v3-wq commented 3 months ago

For Ev install, you have to check in /usr/share/applications

Ah, tere is it...

St3v3-wq commented 3 months ago

As a workaround you can change this:

_find_default_client() {
    this._decoder = new TextDecoder();
    this._app_query = GLib.spawn_command_line_sync("xdg-mime query default x-scheme-handler/mailto");
    this._app_filename = this._decoder.decode(this._app_query[1].slice(0,-1));
    this._app = Shell.AppSystem.get_default().lookup_app(this._app_filename);
    if (this._app) {
        this._app_name = this._app.get_name();
    } else {
        Main.notify("New Mail Indicator: error, no email client found");
    }
}

to this:

_find_default_client() {
    this._app_name = "Evolution";
}

But this way does not display new Mails (red icon).

However, thank You for Your time!

St3v3-wq commented 3 months ago

Ok, fixed.

I fixed it by fixing Evolution. There is no problem with Your extension. The way was (at the end very easy):

$ cp /usr/share/applications/org.gnome.Evolution.desktop ~/.local/share/applications/ $ update-desktop-database -v ~/.local/share/applications

Thanks for Your time!