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
Duplicate events returned on a day when one instance of a recurring event changes time #45
Comments
Using Google Calendar, recurrence is limited by day, so leaving the UID the same for each recurring event would allow checking UID and SEQUENCE for each day before returning found events. |
@carloshanson I'm having the same issue, but with an Apple iCalendar feed. Do you have any workaround, or thoughts as to code or pseudocode for a patch? I'm keen to fix this and I don't want to start from scratch if you had something already. |
@fvox13 My initial though is the We have to prevent changing the UID of the recurring events, and add SEQUENCE to an I haven't had a chance to play with it yet, but I hope to do so this week. |
@carloshanson I am seeing the same issue in Confluence team calendar. Have you made any progress on this one? |
My pull request should resolve the issue, but it breaks the tests. I had hoped that it would be looked and and the tests changed. I consider changing the tests myself. I'll look at it again. |
@carloshanson Thanks! I have downloaded the parser source code from your branch, and tested against the confluence team calendar. It looks good to me! |
@carloshanson Just found out that the fix you put in could not handle some cases which need "UID", "Sequence" and "Reference-id" to identify the event instance. Reference: https://icalendar.org/iCalendar-RFC-5545/3-8-4-4-recurrence-id.html |
Here is a example. The code returns event id: 68170 and 69069, which are supposed to 83168 and 83169.
|
I made some changes, and it works for me now. May need more testings. def add_event(found, event):
key = (event.uid, event.start.date())
original_event = found.get(key)
if original_event is None or event.recurrence_id > original_event.recurrence_id:
found.update({key: event})
elif original_event is None or event.sequence > original_event.sequence:
found.update({key: event}) def __init__(self):
...
self.recurrence_id = None def copy_to(self, new_start=None, uid=None):
...
ne.recurrence_id = self.recurrence_id def create_event(component, tz=UTC):
...
if component.get('rrule'):
event.recurring = True
if component.get('RECURRENCE-ID'):
event.recurrence_id = normalize(component.get('RECURRENCE-ID').dt, tz=tz)
else:
event.recurrence_id = event.start |
Cool. I'm still trying to find time to work on this again, so I can get my changes accepted. |
One more thing, the event with RECURRENCE-ID should not be treated a recurring event. As it is just a instance of a recurring event. So it should be: def parse_rrule(component, tz=UTC):
...
if component.get('rrule') and component.get('RECURRENCE-ID') is None: |
A recurring event was created in the past.
One instance had a time change.
On the date of the event, two events are returned.
The combination of the UID and the SEQUENCE needs to be observed. In this case, both events have the same UID in the calendar, so the one with the higher SEQUENCE should be returned.
Right now, recurring events are copied with each new date and the UID is changed for each by appending a random integer. I don't think the UID should be changed, but I need to test some different recurring scenarios to be sure that keeping the same UID will be okay.
I will work on this, but feel free to add any suggestions while I do.
The text was updated successfully, but these errors were encountered: