-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: validate account properties as a repair step #50985
base: master
Are you sure you want to change the base?
Conversation
/backport to stable31 |
/backport to stable30 |
/backport to stable29 |
d47f311
to
3dfafc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance issue for upgrades that will be an issue on larger instances
public function run(IOutput $output): void { | ||
$numRemoved = 0; | ||
|
||
$this->userManager->callForSeenUsers(function (IUser $user) use (&$numRemoved) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause long update times on larger instances. Please make sure that this is either running in a background job or marked as an expensive repair step so it is manually triggered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or marked as an expensive repair step so it is manually triggered.
It is marked as expensive - basically it is the same as the removed repair step (also called for all seen users).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if you prefer then we can migrate this to a background job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything we can do to reduce time upgrades take is good. Background job would be best as with the expensive repair step there is the risk that the admin just never runs it (or we need extra logic to note as a setup check), but fine either way with me.
Replace `ValidatePhoneNumber` from Nextcloud 21 with a new repair step, `ValidateAccountProperties` which validates and sanitizes all account properties. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
3dfafc9
to
6016ebc
Compare
Summary
Replace
ValidatePhoneNumber
from Nextcloud 21 with a new repair step,ValidateAccountProperties
which validates and sanitizes all account properties.It ensures all existing values are valid (now that we also validate twitter and fediverse it could lead to issues like the reported one).
Checklist