openplanet-nl / plugin-manager

In-game plugin manager, installer, and updater.
6 stars 5 forks source link

Updating a plugin "outside" the plugin manager appears to break the plugin state cache #23

Open sylae opened 1 year ago

sylae commented 1 year ago

This could be a factor of having two Plugin Managers running (one being the one shipped with openplanet, the other being my dev copy), but just in case this is indicative of a possible issue with the plugin cache i thought i'd report this.

I updated Editor Trails to 1.1 using my "dev" version of the plugin manager, and this appears to have messed up the "normal" manager's state and it remains convinced that v1.0 is installed. This persists through trackmania restarts as well as when just the "normal" manager is installed.

anyway obviously this is a bit of an edge case, but like i said, idk if it's just a symptom of something that Might Actually Be An Issue For Normal People, yknow?

image

skybaks commented 1 year ago

I just ran into this issue. I have a plugin folder, but I briefly tested with a zipped version of the plugin. After I was done testing I deleted the zipped version. Now, the plugin manager is notifying me of updates even though my plugin folder is up to date with the published version. This is because updating the PluginCache.json file is skipped for non-zipped plugins so the old version I briefly tested with is stuck in the cache file with no way of getting updated or removed. As part of a potential solution to this it would be nice if there were more checks about what the plugin source was for any given loaded plugin before notifying of an update.

skybaks commented 1 year ago

I fixed my issue by manually deleting the PluginCache.json file when the game was closed. What is the purpose of saving plugin versions to this file? Wouldn't it be easy enough to read all the plugin version into memory once when the game starts up?

skybaks commented 1 year ago

I'm still seeing this issue. I would happily open a pull request to delete the cache file but I don't want to do that without understanding why it existed to begin with.

codecat commented 1 year ago

What is the purpose of saving plugin versions to this file? Wouldn't it be easy enough to read all the plugin version into memory once when the game starts up?

No, because plugins won't exist in memory if they are unloaded (for example, they are blocked by the server).