Skip to content
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

Scope the appdata theming storage for global and users #34599

Merged
merged 5 commits into from
Oct 14, 2022

Conversation

skjnldsv
Copy link
Member

Fix #34596

@PVince81
Copy link
Member

PVince81 commented Oct 14, 2022

  • add hash to the "v=" argument based on user id to avoid seeing another user's background
  • still need shift+refresh for seeing the updated background because the browser is using the old version:

here we should see "v=2" but we see "v=1":
image

this is likely because "apps.scss" is also a cached asset, we need to add a cache buster there as well
it might have worked before when busting the global theme cache as it would force a reload of those files, but busting the global theme is a no-go as it has side effects

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for @skjnldsv's part, please also review what I pushed

@PVince81
Copy link
Member

I've pushed a fix that adds cache busting also for the CSS variables to make sure we load the correct background in apps.
Additionally I've hashed the user id there to make sure we don't see the cached background of another user.
This fixes #34599 (comment)

$this->urlGenerator = $urlGenerator;
$this->themesService = $themesService;
$this->defaultTheme = $defaultTheme;
$this->config = $config;
if ($userSession->getUser() !== null) {
$this->userId = $userSession->getUser()->getUID();

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getUID on possibly null value
@skjnldsv skjnldsv requested review from szaimen, a team, ArtificialOwl, blizzz and juliusknorr and removed request for a team October 14, 2022 11:44
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 14, 2022
@szaimen

This comment was marked as resolved.

@skjnldsv

This comment was marked as resolved.

Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See

2022-10-14-134652.mp4

@szaimen

This comment was marked as off-topic.

@szaimen

This comment was marked as off-topic.

@PVince81

This comment was marked as resolved.

@PVince81

This comment was marked as resolved.

@skjnldsv

This comment was marked as resolved.

@skjnldsv skjnldsv force-pushed the fix/background-appdata-scrope branch from 8a5b526 to acc7a2c Compare October 14, 2022 12:14
@skjnldsv skjnldsv requested a review from szaimen October 14, 2022 12:14
Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works but didn't review the code

@PVince81
Copy link
Member

I've retested admin vs user background and no more shift+refresh is needed, it works smoothly and as expected.
Likewise, the public page had the background configured by the admin

Shipit!

@PVince81 PVince81 mentioned this pull request Oct 14, 2022
1 task
@PVince81
Copy link
Member

I've raised the lower priority #34606 to clean up the old theme cache data since we now moved everything into "appdata*/theming/global/"

@PVince81
Copy link
Member

/rebase

skjnldsv and others added 5 commits October 14, 2022 16:18
@PVince81
Copy link
Member

rebased for CI

and manual backport to save some time... #34612

@blizzz
Copy link
Member

blizzz commented Oct 14, 2022

backgroundVersion is not used anymore, but still migrated in core/Migrations/Version25000Date20221007010957.php. Can be cleaned up afterwards though, just not to forget it.

@PVince81 PVince81 merged commit 2b87aeb into master Oct 14, 2022
@PVince81 PVince81 deleted the fix/background-appdata-scrope branch October 14, 2022 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug high regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [25.0.0RC4] Custom background doesn't stay (404)
4 participants