ensure uid for calendar objects is unique#7042
Merged
LukasReschke merged 1 commit intomasterfrom Nov 7, 2017
Merged
Conversation
| ->andWhere($q->expr()->eq('uid', $q->createNamedParameter($extraData['uid']))); | ||
|
|
||
| $result = $q->execute(); | ||
| $count = (int) $result->fetchColumn(); |
Codecov Report
@@ Coverage Diff @@
## master #7042 +/- ##
============================================
+ Coverage 50.61% 50.62% +<.01%
- Complexity 24297 24298 +1
============================================
Files 1577 1577
Lines 92922 92932 +10
Branches 1359 1359
============================================
+ Hits 47037 47046 +9
- Misses 45885 45886 +1
|
1b8daa1 to
86d6b91
Compare
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
86d6b91 to
4df08f2
Compare
LukasReschke
approved these changes
Nov 7, 2017
Member
|
@georgehrke Please open backports if you consider this backport worthy. Thanks! :) |
Member
|
That said, how big is the real-life risk here? 😄 – Does this existing behavior lead to data loss or so? |
Member
Author
|
@LukasReschke Already done ;) |
Member
Author
No data loss, just not standard compliant and might provoke errors if clients request events by UID. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment it's possible to have the same UID for multiple calendar objects in a calendar. This doesn't comply with the calendar standard.
https://tools.ietf.org/html/rfc4791#section-4.1
--
Yes, have have to add a unique key for calendarid and uid in the database, BUT:
Before we can do that, we have to fix existing calendar data of a user, otherwise the database migration will fail.
We can only do pre-db-change migrations with Nextcloud 13+, right now we need something we can backport as well.
--
To test this:
It will work in master (wrong behavior) and will return a 400 on this branch (correct behavior).