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

fix(profile): Set profile config cache directly after writing it to DB #37170

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/private/Profile/ProfileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,15 @@ public function getProfileConfig(IUser $targetUser, ?IUser $visitingUser): array
$this->filterNotStoredProfileConfig($config->getConfigArray()),
));
$this->configMapper->update($config);
Copy link
Member Author

Choose a reason for hiding this comment

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

suggestion: BTW, do we really need to update the config at each call? Can't we just check if the merged config has been updated and only update it in this case?

$this->configCache[$targetUser->getUID()] = $config;
$configArray = $config->getConfigArray();
} catch (DoesNotExistException $e) {
// Create a new default config if it does not exist
$config = new ProfileConfig();
$config->setUserId($targetUser->getUID());
$config->setConfigArray($defaultProfileConfig);
$this->configMapper->insert($config);
$this->configCache[$targetUser->getUID()] = $config;
$configArray = $config->getConfigArray();
}

Expand Down
Loading