fthx / dock-from-dash

GNU General Public License v3.0
97 stars 20 forks source link

Still getting "Error: Invalid work id" Javascript errors when launching/closing applications after having enabled this extension #93

Closed nekohayo closed 8 months ago

nekohayo commented 1 year ago

I saw issue #56, #71, the attempted mitigation here in commit 6247f9f5f, but to this day, with GNOME Shell 45.1 and the latest stable version of this extension, I still get this while looking at journalctl -f, only after having enabled this extension during the current session (a fresh GNOME Shell session without ever enabling the extension does not cause the issue to happen):

JS ERROR: Invalid work id 3: Error: Invalid work id 3
    queueDeferredWork@resource:///org/gnome/shell/ui/main.js:972:18
    _queueRedisplay@resource:///org/gnome/shell/ui/dash.js:489:14
    _init/<@resource:///org/gnome/shell/ui/dash.js:390:18
    @resource:///org/gnome/shell/ui/init.js:21:20

JS ERROR: Invalid work id 3: Error: Invalid work id 3
    queueDeferredWork@resource:///org/gnome/shell/ui/main.js:972:18
    _queueRedisplay@resource:///org/gnome/shell/ui/dash.js:489:14
    _modify_native_click_behavior/AppDisplay.AppIcon.prototype.activate@file:///home/the_user/.local/share/gnome-shell/extensions/dock-from-dash@fthx/extension.js:300:34
    activateDefault@resource:///org/gnome/shell/ui/search.js:842:33
    _onKeyPress@resource:///org/gnome/shell/ui/searchController.js:299:37
    @resource:///org/gnome/shell/ui/init.js:21:20

It's visibly harmless, but filing it here in case someone figures out the cause, and/or if you want to do additional error catching.

fthx commented 1 year ago

I paste the reason here: https://github.com/fthx/dock-from-dash/issues/56#issuecomment-1138420600

nekohayo commented 1 year ago

Oh, I thought your extension was meant to catch and hide those errors... Currently it does not happen only "when the extension gets disabled", it happens everytime you launch an app from it, unlike that comment says on the other ticket. That's why I opened a new one.

But if it needs signals work in GNOME Shell to fix it too, the the upstream ticket could benefit from an actionable todo description more precise than "The GS dash's signals need to be cleaned up, as it was not built to be reused elsewhere"... and a patch over there, I guess. Unfortunately I'm not in a position to be able to contribute a patch.

fthx commented 1 year ago

I'll have a deep look about this.

fthx commented 1 year ago

I must confess I do use a modified version of panel-free extension that shows overview hovering the bottom. Simpler, GNOME-styled and efficient.

fthx commented 1 year ago

Wayland session, I do not experience any log message when launching/closing an app.

fthx commented 1 year ago

Ok: I have to disable extension, then reenable it, then this "bug" occurs.

fthx commented 1 year ago

So that's happening when coming back from sleep, eg.

fthx commented 1 year ago

Done: https://github.com/fthx/dock-from-dash/commit/6c907d32f9f518d59f678e9a152a568152beb9e8

Could you test this AND PLEASE test the dock for some time (just a session of 10 minutes of usual use), because there are some other changes I made in Bottom Overview extension (that works well)?

Feeel free to reopen if needed. Thanks!

fthx commented 1 year ago

This breaks the app icons dnd...

fthx commented 1 year ago

Every time the extension is disabled, the _dock._workId is increased by 1. So the recorded previous workId leads to a void data that causes this message: https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/main.js#L971

fthx commented 1 year ago

Florian's answer: https://discourse.gnome.org/t/dock-from-dash-a-light-dock-for-gnome-shell/8434/2?u=fthx

fthx commented 8 months ago

Finally I found a way. https://github.com/fthx/dock-from-dash/commit/8160240a19d771711f8e6d53e60ae65ef4e3e710 Thanks to myself. It was so easy. After – hem – many unsuccessful tries!!

nekohayo commented 8 months ago

Thank you! Even though I have no clue about the code, I appreciate your attention to quality. Let's hope it solves some heisenbugs :)