Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Oct 27, 2025

Summary

  • ensure the prefix is changed when an app is (dis)enabled
  • ensure the app ids are included in the hash instead of only the version numbers
  • ensure hash is deterministic by always use the same order.

see also #54383 (comment)

Checklist

- ensure the prefix is changed when an app is (dis)enabled
- ensure the app ids are included in the hash instead of only the
  version numbers
- ensure hash is deterministic by always use the same order.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux added this to the Nextcloud 33 milestone Oct 27, 2025
@susnux susnux requested a review from come-nc October 27, 2025 15:20
@susnux susnux requested a review from a team as a code owner October 27, 2025 15:20
@susnux susnux requested review from leftybournes, salmart-dev and yemkareems and removed request for a team October 27, 2025 15:20
@susnux susnux added bug 3. to review Waiting for reviews labels Oct 27, 2025
@susnux
Copy link
Contributor Author

susnux commented Oct 27, 2025

/backport to stable32

@susnux susnux merged commit 144e864 into master Oct 28, 2025
205 of 212 checks passed
@susnux susnux deleted the fix/cache-key branch October 28, 2025 16:03
@danxuliu
Copy link
Member

There is still a problem with maintenance mode and cached routes even with this fix.

The global prefix is the same if the maintenance mode is enabled or disabled. However, the routes generated during maintenance mode do not seem to include apps/XXX routes. Therefore, if the route cache is generated while in maintenance mode the cache is not valid once the maintenance mode is disabled, but the same cache will be still used, thus leading to Page not found errors. Routes can be generated even while in maintenance mode due to a special handling of JavaScript files, which skip the maintenance mode and are matched even in that case, which cause the route cache to be regenerated if it was empty.

How to reproduce:

  • Use a development server and ensure that no other requests than the ones below are handled
  • Enable APCu cache (add 'memcache.local' => '\\OC\\Memcache\\APCu', to config.php) if not enabled already
  • Enable maintenance mode (occ maintenance:mode --on)
  • Reset the APCu cache (restart the web server / FPM, call apcu_clear_cache(), use https://github.com/krakjoe/apcu/blob/master/apc.php...)
  • Get a JavaScript file with curl https://{YOUR_SERVER}/index.php/js/core/merged-template-prepend.js
  • Disable maintenance mode (occ maintenance:mode --off)
  • Get the Files apps page with curl --head https://{YOUR_SERVER}/index.php/apps/files; a 404 Not Found response is received
  • Reset the APCu cache (restart the web server / FPM, call apcu_clear_cache(), use https://github.com/krakjoe/apcu/blob/master/apc.php...)
  • Get the Files apps page with curl --head https://{YOUR_SERVER}/index.php/apps/files; a 401 Unauthorized response is received

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants