Maybe flush ~/.cache when changing ostree versions

I just spent some time debugging mysterious KDE failures I was having in kinoite, and they were mostly due to having contents in my ~/.cache that KDE didn’t think were consistent as I moved between different ostree versions.

I think I will write a bash script that saves the OSTREE_VERSION from /etc/os-release somewhere, and when it detects that has changed, it will flush ~/.cache. But I either have to be careful not to flush anything just put there at login, or I have to do this prior to logging in, else it will cause things that depend on ~/.cache content provided at login to fail.

Does anyone have a recommendation about the best way to accomplish this? I could make it a systemd service, but when to have it run to avoid any damage to content put into ~/.cache by logging in?

I would recommend filing a bug upstream in KDE instead to make sure this gets fixed in the proper place. If you can link it here that would be great.

I am not sure this would be considered a KDE bug, as it might not occur when normally progressing forward in time (via upgrades). And similar problems might occur to other modules besides KDE that save cache state when timeshifting backwards and forwards among ostree versions.

1 Like