Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Plugin install from ZIP getting stuck indefinitely #706

Merged

Conversation

SilentException
Copy link
Contributor

Please tick as appropriate:

  • I have tested this code on a steam deck or on a PC
  • My changes generate no new errors/warnings
  • This is a bugfix/hotfix
  • This is a new feature

Description

This fixes issue: N/A

After debugging why plugin manual ZIP installations sometimes fail to finish and gets stuck I've noticed that plugin name is being extracted from folder name that is in the ZIP and not from the plugin.json file. This name is then used to search for plugin folder later on in the process (plugin_folder = self.find_plugin_folder(name)) and since the plugin folder name is pretty much guaranteed to be different than plugin name - assertion (assert plugin_folder is not None) is triggered.

This fixes it by reading the plugin name from plugin.json file that is included in the ZIP.
It might also be a good idea to check why the installer gets stuck when the assertion error is triggered but it is out of scope for this PR.

@TrainDoctor TrainDoctor added bug Something isn't working python Pull requests that update Python code labels Sep 22, 2024
@TrainDoctor TrainDoctor requested review from a team September 22, 2024 03:31
@TrainDoctor
Copy link
Member

@SteamDeckHomebrew/decky-testers priority on testing this one out so it can be released as part of v3.0.1!

@eXhumer
Copy link
Contributor

eXhumer commented Sep 22, 2024

This fixes it by reading the plugin name from plugin.json file that is included in the ZIP.

#578 (review)

#578 (comment)

@SilentException
Copy link
Contributor Author

This fixes it by reading the plugin name from plugin.json file that is included in the ZIP.

#578 (review)

#578 (comment)

Interesting, but it is not working as intended. The current code is deriving plugin name from folder name in the ZIP and then searching for that same name by traversing ~/homebrew/pluginsand looking into plugin.json for the name.

@SilentException
Copy link
Contributor Author

Here are steps to reproduce and also test the fix.

You need GH actions run for new version of HLTB plugin: https://github.com/SteamDeckHomebrew/decky-plugin-database/actions/runs/10836675929
Not all plugins can trigger this bug (it depends on folder and plugin name).

It's a zip in a zip type scenario so unzip one layer first.
Try to manually install the ZIP. The installation will hang - not hang the system but hang as not finish, indefinitely - you can still cancel it. Plugin files will be extracted but noting will happen after that. After cancelling, you will not see plugin in the plugin list either (without restart)

Remove the previously installed plugin (if you want a clean state) and install the PluginLoader from this PR. Do the same manual ZIP installation - everything will be fine this time. Plugin will be installed, progress bar will move forward and Decky will show the new plugin in the list.

@SilentException
Copy link
Contributor Author

Anyone cares to take a look? I believe I gave good amount of info for this to be reviewed and tested?

Copy link
Contributor

@suchmememanyskill suchmememanyskill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Steam version 1728093750 (beta), Decky 1781c19 + 819bd48 (Latest main + this PR). Installing CSS Loader via zip works as expected now

Copy link
Member

@PartyWumpus PartyWumpus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(reviewing on behalf of testers i guess?) Works well, although at some point it would be nice if errors from here propagated up to the UI as toasts or something. Not a blocker, it was the same before too.
Steam version: 1726604483 (stable)

@TrainDoctor
Copy link
Member

Tested this myself and experienced no major issues during plugin install or during normal operation. Apologies for this taking so long to get merged.

@TrainDoctor TrainDoctor merged commit 8d2b252 into SteamDeckHomebrew:main Oct 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Pull requests that update Python code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants