-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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(theming): Don't reset the cachebuster value when we reset theming #46428
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
SystemKeeper
changed the title
fix(theming): Don't reset the cachebuster value when we reset themeing
fix(theming): Don't reset the cachebuster value when we reset theming
Jul 10, 2024
SystemKeeper
force-pushed
the
fix/noid/fix-cypress-test-cachebuster
branch
from
July 10, 2024 21:57
9b54602
to
4f12584
Compare
/backport to stable29 |
/backport to stable28 |
susnux
approved these changes
Jul 10, 2024
@@ -437,7 +437,11 @@ | |||
* Revert all settings to the default value | |||
*/ | |||
public function undoAll(): void { | |||
// Remember the current cachebuster value, as we do not want to reset this value | |||
// Otherwise this can lead to caching issues as the value might be known to a browser already | |||
$cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0'); |
Check notice
Code scanning / Psalm
DeprecatedMethod Note
The method OCP\IConfig::getAppValue has been marked as deprecated
$this->config->deleteAppValues('theming'); | ||
$this->config->setAppValue('theming', 'cachebuster', $cacheBusterKey); |
Check notice
Code scanning / Psalm
DeprecatedMethod Note
The method OCP\IConfig::setAppValue has been marked as deprecated
nickvergessen
approved these changes
Jul 11, 2024
This was referenced Jul 11, 2024
3 tasks
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
From the other PR:
After the PR was merged the cypress-tests
theming/AdminSettings
kept failing. Since we now don't have apragma: no-cache
header anymore, we now rely oncache-control
header and our cachebuster implementation to make sure that we get the correct files. For some files, we rely on a cachebuster based on appVersion and cachebuster value:server/lib/private/TemplateLayout.php
Lines 298 to 331 in b97c7df
To make sure individual tests are reliable, we reset the theming settings completely before each test:
server/apps/theming/lib/ThemingDefaults.php
Lines 439 to 442 in b97c7df
This also results in a removed cachebuster value and therefore we get the same urls in different tests which (with the changes of the other PR) results in electron to use a cached version of the file, instead of requesting the latest one.
To fix this, we keep the cachebuster value when resetting theming and increase it afterwards.
TODO
Checklist