-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
reduce adressbook change events and handling #17001
Conversation
... from four to one on avatar updates Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
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.
I don't have an LDAP to test, but code wise this looks fine 👍
I'm ok with this as a hot fix, but it should stay a hot fix and not become the permanent solution.
Code looks good 👍 Don't have a ldap setup either 🙈 Lines 1236 to 1237 in 7927aeb
Here is another place for the follow up. If we are going to delete the user anyway we don't have to trigger a change. This might save some calls. |
can you elaborate? |
* avoids useless FS operation * avoids useless DB writes * avoids useless addressbook updates * addendum to #17001 Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Why can't we replace it in one step. Is there really a need for remove and recreate? |
My understanding is that there are several different sized version of the avatar. Deleting them first ensures that no old one is left. |
Master is no 18 development. If this needs to go into 17 please follow the normal backport procedures after merging. |
/backport to stable17 |
/backport to stable16 |
still looking for another reviewer :) |
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.
🐘
backport to stable17 in #17351 |
backport to stable16 in #17352 |
* avoids useless FS operation * avoids useless DB writes * avoids useless addressbook updates * addendum to #17001 Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* avoids useless FS operation * avoids useless DB writes * avoids useless addressbook updates * addendum to #17001 Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This was observed when updating the Avatar from LDAP.
When setting a new avatar against the
IAvatar::set()
implementation, first the old avatar is removed. That cleans up the files and does some config settings. However, this cause also the addressbook to be updated with an empty avatar.Then, when the new avatar is set, this happened again.
Now on LDAP this happened twice due to a wrong passOn parameter in the LDAP's proxy, which would lead to do it twice.
It can be easily reproduced:
select count(*) from oc_addressbookchanges
Observed behaviour: the changes count is +4
Desired behaviour: the changes count is +1 (with this patch)
Now you could argue there should be no change when the avatar is still the same and there you are right. There will be a follow up, because that solution might cover the deeper buried behaviour.