Vencord / Vesktop

Vesktop is a custom Discord App aiming to give you better performance and improve linux support
GNU General Public License v3.0
4.43k stars 196 forks source link

[Bug] Restart option in tray menu only quit and doesn't reopen. #949

Open tobycm opened 2 weeks ago

tobycm commented 2 weeks ago

Discord Account

tobycm

Operating System

Ubuntu 24.04

Linux Only ~ Desktop Environment

Gnome on Wayland

Package Type

deb

What happens when the bug or crash occurs?

The option Restart in the Vesktop tray menu only stop Vesktop, but doesn't restart itself.

What is the expected behaviour?

It should start itself after closing.

How do you recreate this bug or crash?

Click the Restart option in the tray menu.

Debug Logs

❯ vesktop
Checking for beta autoupdate feature for deb/rpm distributions
Found package-type: deb
Checking for update
[arRPC > ipc] listening at /run/user/1000/discord-ipc-0
[arRPC > websocket] listening on 6463
[arRPC > process] started
[22977:1108/203622.892309:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
Update for version 1.5.3 is not available (latest version: 1.5.3, downgrade is disallowed).
checkForUpdatesAndNotify called, downloadPromise is null

Request Agreement

tobycm commented 2 weeks ago

The Relaunch option does work if I clone the repo and run it with pnpm run start however.

tobycm commented 2 weeks ago

Weirdly enough, running vesktop in the Gnome terminal or launching Vesktop from the Applications view, the Relaunch option will malfunctioned, but it will work if I run vesktop in the vscode terminal or if I run pnpm run start in the Vesktop repo folder.

Vendicated commented 2 weeks ago

works for me using RPM on fedora. likely something wrong with your system

can anyone else using the deb package reproduce this?

NerjalNosk commented 6 days ago

Running deb release, used to work on Ubuntu 22.0.4, now any restart doesn't work anymore on Ubuntu 24.0.4

Running from a terminal (no special command option provided) gives the following output: vesktop.log

Vendicated commented 6 days ago

if simply updating your system broke it, it's not something we can fix

all vesktop does is use electron's apis to initiate a relaunch & exit https://www.electronjs.org/docs/latest/api/app#apprelaunchoptions

its either an issue with ubuntu or with electron

it would be very useful if one of you made a minimal electron reproduction example that demonstrates this bug and reports it to the electron repo. use this tool https://www.electronjs.org/fiddle and use the code sample from the above doc and see if it happens there too

NerjalNosk commented 6 days ago

Would appear to be related to electron updater.

They do already have a few issues about that, Vesktop might just need to update the dependency

Vendicated commented 6 days ago

the electron-updater log is unrelated, feel free to ignore it

NerjalNosk commented 6 days ago

Tried running the following with a bare Electron 33.2.0 project:

const electron = require("electron")

function createWindow() {
    const mainWindow = new electron.BrowserWindow({
        width: 800,
        height: 600
    });
}

electron.app.whenReady().then(() => {
    createWindow()

    electron.app.on('activate', () => {
        if (electron.BrowserWindow.getAllWindows().length === 0) {
            createWindow()
        }
    })
})

electron.app.on('quit', () => {
    electron.app.relaunch()
})

relaunch worked just fine, no issue with bare Electron restart on Ubuntu 24.

Additionally, I may mention that this Ubuntu is a fresh install, and not transitioned from any earlier version of Ubuntu, thus possibly containing broken packages/apps.

As such, either it is an active issue for Electron 33.0.2, but that has since been fixed, and thus would require Vesktop to upgrade Electron, or a pure Vesktop issue.

Vendicated commented 5 days ago

like i said, it's not possible for it to be a vesktop issue. the relaunch code has always been the same and simply follows what any other electron app also does.

it might be that this issue only happens once bundled to .deb ~ we use electron-builder to create the deb package

if you use this template https://github.com/electron-userland/electron-webpack-quick-start?tab=readme-ov-file#getting-started and run yarn dist, it should build a deb package. your electron code would go in src/main/index.js