Vendicated / Vencord

The cutest Discord client mod
https://vencord.dev
GNU General Public License v3.0
8.93k stars 1.27k forks source link

[Bug] Vencord shows a error popup when the settings files are read only #2259

Closed coffeeispower closed 7 months ago

coffeeispower commented 7 months ago

Discord Account

coffeeispower

What happens when the bug or crash occurs?

I use home manager in NixOS and i tried to automatically configure vencord with a custom theme with the color scheme generated from my wallpaper by stylix.

However when home manager sets up the files, it symlinks the file from the nix store into the home directory, and makes the file read-only and vesktop seems to have trouble opening the file in write mode and crashes at startup.

What is the expected behaviour?

I would expect vesktop to open normally and just don't allow the settings to be changed from the UI.

How do you recreate this bug or crash?

  1. Make .config/vesktop folder read-only
  2. Try starting Vesktop

Errors

A JavaScript error occurred in the main process
Uncaught Exception:
Error: EROFS: read-only file system, open '/home/tiago/.config/vesktop/settings.json'
    at Object.openSync (node:fs:603:3)
    at Object.func [as openSync] (node:electron/js2c/node_init:2:2214)
    at writeFileSync (node:fs:2324:35)
    at VCDMain:1:2583
    at VCDMain:1:2222
    at Set.forEach (<anonymous>)
    at ra.markAsChanged (VCDMain:1:2211)
    at VCDMain:1:3282
    at VCDMain:1:225
    at VCDMain:1:4212

Request Agreement

Vendicated commented 7 months ago

then don't make the settings file readonly

Vendicated commented 7 months ago

actually fixed via https://github.com/Vendicated/Vencord/commit/9aa205b5ec6dc1f380fd61941a0cb9dfa74f814c

but seriously don't do this. some plugins rely on settings for internal state. making settings readonly is just not supported