-
-
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/caldav/eventcomparisionservice uses wrong array comparison #44017
Fix/caldav/eventcomparisionservice uses wrong array comparison #44017
Conversation
Do you mind adding a test to |
Done. Not really sure if such a small change warrants the tests, but if it helps the collaboration, I am happy to provide it. |
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.
Thanks for the effort, appreciated.
Do you mind fixing the lint issues reported by the CI? The other failures are unrelated. We can take care of that if you prefer.
Can you squash all your commits into one? Easiest is probably:
|
8998801
to
ebc3925
Compare
@miaulalala should be clean now. |
Old comparison implementation compares each element of the array against each other with no respect for the associated array label, which leads to wrongful removals because one value is accidentally present in a completely different label. New comparison works 'by-label' individually. Partly fixes nextcloud#41084 because changes between 'SEQUENCE' not present, 'SEQUENCE:0' and 'SEQUENCE:1' were not detected in the old implementation and thus no email update sent. Co-authored-by: Christoph Wurst <ChristophWurst@users.noreply.github.com> Signed-off-by: Robert C. Schaller <gtbc_robert.schaller@rsxc.de>
ebc3925
to
fa6e613
Compare
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
/backport to stable26 |
/backport to stable27 |
/backport to stable28 |
Summary
Fixes the comparison of two arrays that contain relevant differences between two events.
Old comparison implementation compares each element of the array against each other with no respect for the associated array label, which leads to wrongful removals because one value is accidentally present in a completely different label. New comparison works 'by-label' individually.
Refer to php manual https://www.php.net/manual/en/function.array-diff.php
Partly fixes #41084 because changes between 'SEQUENCE' not present, 'SEQUENCE:0' and 'SEQUENCE:1' were not detected in the old implementation and thus no email update sent.
@miaulalala please inspect. Small fix for your otherwise comprehensive contribution for nextcloud/calendar#3919
TODO
#41084 needs to remain open as there is a second issue, which prevents the SEQUENCE evaluation in certain cases.
/backport to stable28
/backport to stable27
/backport to stable26