SteamDeckHomebrew / decky-loader

A plugin loader for the Steam Deck.
https://decky.xyz
GNU General Public License v2.0
4.5k stars 156 forks source link

[BUG] Plugin reinstallation breaks plugin order #679

Open milroneth opened 1 month ago

milroneth commented 1 month ago

Please confirm

Bug Report Description

When reinstalling plugins (either through the store page or the Decky settings "Plugins" tab), the uninstallation step involved removes the plugin from settings/loader.json:pluginOrder.

This leaves the plugin in limbo where the current Decky instance still knows its position in the list, but the next load will float the plugin to the edge. This can be avoided by the user immediately re-ordering the list by moving said plugin one place up/down and back again, so that it gets readded to pluginOrder in its previous place.

Expected Behaviour

A plugin being reinstalled should not lose its position in the plugin list unexpectedly on the next restart.

It should not be removed from pluginOrder when it's uninstalled as part of a reinstallation, or if that is impractical, it should be immediately re-added to the list in its current position in memory after re-installation is complete.

SteamOS version

SteamOS 3.5.19 Stable

Selected Update Channel

Prerelease

Have you modified the read-only filesystem at any point?

No

Backend Logs

deckylog.txt

Frontend Logs

cef_log.txt

TrainDoctor commented 1 month ago

I have also found that reloading plugins with permissions changed to the plugins directory and it's contents is causing plugins to not re-appear after being reloaded. Since these two issues are likely related, I'm adding this onto this bug report.

TrainDoctor commented 2 hours ago

@milroneth could you see if you can recreate this issue? I haven't had any reports of it since you made us aware.

milroneth commented 57 minutes ago

Still valid in v3.0.0 stable. I forgot to pretend-reorder yesterday after updating Game Theme Music and today I found it on top of the list.

Just tested specifically for this issue, to make sure I wasn't wrong, I reinstalled a random plugin. It was removed from the json, jumped on top of the plugin list on reboot.

EDIT: Probably related to this, when a plugin is fresh installed, trying to reorder it before a loader restart is wonky at best, you start moving one plugin and end up moving another. I think that every plugin installation, no matter the source of that action, should trigger a re-write of loader.json to disk (without reading it first at that moment), before any other actions mess things up.