SpacingBat3 / WebCord

A Discord and SpaceBar :electron:-based client implemented without Discord API.
MIT License
1.88k stars 94 forks source link

Cache and other not config data gets saved in XDG_CONFIG_HOME #421

Open Toorero opened 1 year ago

Toorero commented 1 year ago

Problem description

If I list my WebCord folder saved in XDG_CONFIG_HOME it shows a bunch of stuff that should clearly not be there according to the freedesktop (XDG) specification

This is quite messy and not very maintainable. Improper storage will cause problems or require special handling to function properly:

  1. Exclude cache from your backups
  2. Removing all cache if you're running low on space
  3. Only sync config data to cloud services like Nextcloud to sync your config across devices.

Fix

Move the directories Cache,Code Cache, GPUCache, DawnCache and the CacheStorage of the service workers into XDG_CACHE_HOME/WebCord. There may be more "non-essential (cached) data" to be stored there but I'm not familiar what stores what. Also, other data like the windowState and Cookies could be moved into the XDG_STATE_HOME.

SpacingBat3 commented 1 year ago

@Toorero most of these files/directories are actually created by Chromium in these paths and I might not be able to replace them. Moreover, it might not be the best idea to overwrite the default behaviour from Chromium/Electron, as it would make its storage paths non-standard for WebCord when comparing to another Electron software – and there are some apps already detecting and utilizing Chromium paths on Linux like BleachBit to provide its functionality, so if WebCord would be an exception, it could break more stuff than actually fix.

I would recommend reporting in on Electron, which would not only fix it for WebCord, but also make any other Electron-based application work in the same way. As of myself, I will treat this issue ticket as lower-priority ones and possibly work on it during/after rewrite of the WebCord.