Skip to content
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

bug: events duplicated in v3.1.0. #164

Closed
zoifar opened this issue Aug 21, 2024 · 2 comments · Fixed by #166
Closed

bug: events duplicated in v3.1.0. #164

zoifar opened this issue Aug 21, 2024 · 2 comments · Fixed by #166
Labels
bug Something isn't working

Comments

@zoifar
Copy link

zoifar commented Aug 21, 2024

Duplicated instances of the same event are returned in v3.1.0. The bug is not present in v2.1.3.

To Reproduce

import recurring_ical_events
import icalendar
ical_string="""BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTAMP:20240821T032819Z
DTSTART;VALUE=DATE:20240401
DTEND;VALUE=DATE:20240408
SUMMARY:test123
CATEGORIES:other
UID:111
ORGANIZER:aaa
RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=MO
CREATED:20240311T051101Z
LAST-MODIFIED:20240311T051101Z
SEQUENCE:1
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20240821T032820Z
DTSTART;VALUE=DATE:20240826
DTEND;VALUE=DATE:20240902
SUMMARY:test123
CATEGORIES:other
UID:111
ORGANIZER:aaa
RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=MO
RECURRENCE-ID;VALUE=DATE:20240826
CREATED:20240729T125457Z
LAST-MODIFIED:20240729T125457Z
SEQUENCE:1
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20240821T032820Z
DTSTART;VALUE=DATE:20240826
DTEND;VALUE=DATE:20240902
SUMMARY:test123
CATEGORIES:other
UID:111
ORGANIZER:aaa
RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=MO
RECURRENCE-ID;VALUE=DATE:20240826
CREATED:20240729T125551Z
LAST-MODIFIED:20240729T125551Z
SEQUENCE:1
END:VEVENT
END:VCALENDAR
""" 


calendar = icalendar.Calendar.from_ical(ical_string)
events=recurring_ical_events.of(calendar).at([2024,8])

for event in events:
    start = event["DTSTART"].dt
    duration = event["DTEND"].dt - event["DTSTART"].dt
    print("start {} duration {}".format(start, duration))

ICS file

BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTAMP:20240821T032819Z
DTSTART;VALUE=DATE:20240401
DTEND;VALUE=DATE:20240408
SUMMARY:test123
CATEGORIES:other
UID:111
ORGANIZER:aaa
RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=MO
CREATED:20240311T051101Z
LAST-MODIFIED:20240311T051101Z
SEQUENCE:1
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20240821T032820Z
DTSTART;VALUE=DATE:20240826
DTEND;VALUE=DATE:20240902
SUMMARY:test123
CATEGORIES:other
UID:111
ORGANIZER:aaa
RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=MO
RECURRENCE-ID;VALUE=DATE:20240826
CREATED:20240729T125457Z
LAST-MODIFIED:20240729T125457Z
SEQUENCE:1
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20240821T032820Z
DTSTART;VALUE=DATE:20240826
DTEND;VALUE=DATE:20240902
SUMMARY:test123
CATEGORIES:other
UID:111
ORGANIZER:aaa
RRULE:FREQ=WEEKLY;INTERVAL=3;BYDAY=MO
RECURRENCE-ID;VALUE=DATE:20240826
CREATED:20240729T125551Z
LAST-MODIFIED:20240729T125551Z
SEQUENCE:1
END:VEVENT
END:VCALENDAR

Expected behavior

duplicated events are not returned

start 2024-08-05 duration 7 days, 0:00:00
start 2024-08-26 duration 7 days, 0:00:00

Console output

start 2024-08-05 duration 7 days, 0:00:00
start 2024-08-26 duration 7 days, 0:00:00
start 2024-08-26 duration 7 days, 0:00:00

Version:
3.1.0

pip list                         
Package               Version
--------------------- -----------
icalendar             5.0.13
pip                   23.3.1
python-dateutil       2.9.0.post0
pytz                  2024.1
recurring-ical-events 3.1.0
setuptools            69.0.2
six                   1.16.0
tzdata                2024.1
x-wr-timezone         0.0.7

Additional context

This is generated by atlassian confluence calendar.


We're using Polar.sh so you can upvote and help fund this issue. We receive the funding once the issue is completed & confirmed by you. Thank you in advance for helping prioritize & fund our work. Fund with Polar
@zoifar zoifar added the bug Something isn't working label Aug 21, 2024
@niccokunzmann
Copy link
Owner

Thanks for the issues!

@niccokunzmann
Copy link
Owner

This is fixed in v3.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants