Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
22.47k stars 1.55k forks source link

[BUDI-6813] Prune unused plugins from app metadata #10161

Open ConorWebb96 opened 1 year ago

ConorWebb96 commented 1 year ago

This might actually be pretty tricky. When saving a screen, we would need to search all screens inside the app to see if a certain plugin is still in use. It's not feasible to read all screens and search them whenever any tiny component modification is made, so this probably needs implemented some other way.

It could probably be some sort of background job (if we have such a concept) which runs every day and checks whether all plugins defined in each apps "usedPlugins" array is indeed still used.

Other hooks could potentially be:

But I think it definitely needs to be some less frequent event as it's going to be an expensive operation.

Importantly though, this error is harmless. It's simply trying to load a file which does not exist and you'll only see the error if you have the console open - there is nothing displayed to the user.

Original issue below:

Checklist

Hosting

Describe the bug Deleted plugins which have been removed both from the app and the plugins area have a 404 console error.

To Reproduce Steps to reproduce the behavior:

  1. Add any custom plugin
  2. Use the plugin some where in an app.
  3. Remove the plugin from the plugins area.
  4. Delete the plugin that was used within your app
  5. View the app page an error will appear saying the plugin isn't found

Expected behavior No 404 console error should appear when a plugin is remove and is no longer being used anywhere within an app.

Screenshots

Screenshot_2023-03-30_at_09.01.15.png

From SyncLinear.com | BUDI-6813

carmas123 commented 1 year ago

At this moment if you install a plugin it is no longer possible to remove it otherwise you will always receive the 404 error.

If you install a plugin and then realize that it is not what you wanted, we cannot remove it even if it is not used in any screen.

Yesterday I tried to install SuperTable to do some tests and then I removed it from all the screens and uninstalled it, the result is that now I always have the 404 error in the console.

I also tried removing all the screens but without success.

I believe that this is a big problem also because if in the free version the limit is 10 plugins as you cannot remove them to avoid having the 404 the limit is reached very fast.

Questo è quello che esce nella console: image

aptkingston commented 12 months ago

Hey @carmas123. You're right that you will get 404s in the console, but these are totally harmless as mentioned in the description. They do not affect app performance, have no effect on your plugin limit and are only visible when showing the console. I would like to fix them in a future update, but this isn't on the immediate roadmap.