nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.77k stars 4k forks source link

[Bug]: if an app exists in `apps` and `custom_apps` folder, `apps` will be picked first for js and css ressources #37043

Open skjnldsv opened 1 year ago

skjnldsv commented 1 year ago

Bug description

When you use addScript and request a script of your app to be loaded AND you have different versions of the app in both of your apps folders THEN you will have ressources loaded from the apps folder, even if the version is lower

Steps to reproduce

  1. Setup a custom_apps folder
  2. Install latest talk in custom_apps
  3. Install old talk (11.x.x) in apps folder
  4. Load the page image

Expected behavior

All the ressources requests should be loaded from the default latest app root instead

szaimen commented 1 year ago

cc @ArtificialOwl as this looks like a pretty big problem with multiple app versions.

joshtrichards commented 1 year ago

Is there a good reason for supporting multiple versions of an app being installed simultaneously? Only one can truly be active at a time anyhow.

I think we should just add an admin setup check that considers this an invalid situation and tells the admin to eliminate the duplicate apps (i.e. #40063).

szaimen commented 1 year ago

Is there a good reason for supporting multiple versions of an app being installed simultaneously? Only one can truly be active at a time anyhow.

Yes, the idea was to allow to update shipped app via the appstore...

szaimen commented 8 months ago

@ArtificialOwl now that you released https://github.com/nextcloud-releases/related_resources/releases/tag/1.2.0 to the store, https://apps.nextcloud.com/apps/related_resources, I suppose people will run into the above issue. So would you mind having a look at the problem above?

joshtrichards commented 4 days ago

Yes, the idea was to allow to update shipped app via the appstore...

Maybe we make the logic prefer the writable apps path (under the assumption it's the one most likely to be the newest/updated/from-the-app-store one).