-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Events with bad start / end order #132
Comments
Thanks for reporting this! Would you like to submit a fix? I would add that it is probably good to check that JOURNAL and the other components also work in such a case. |
True. This might be another issue and a good suggestion is welcome! |
I'm not sure what would be a fix for that. Inverting start/end may not be the right solution since lib users would not expect it to change the data. I'm thinking about 3 options:
|
This is the data:
It looks like someone just accidentally swapped DTSTART and DTEND. (usually, the one attribute is positioned before the other. It might be worth reporting this back to the calendar implementation.) I see two issues:
Splitting allows clear closing criteria. What are your thoughts? |
Sorry, I lied and did not copy-paste true-life iCal data sample 😬. It's just an example which caused the lib to crash. I'm responsible for the strange order of DTSTART and DTEND. Here's a real-life sample extracted from a Sogo calendar:
I agree that it should not happen often, but I've two seen it two times here with Sogo calendars. So I suppose it can occur to others. I think we shouldn't reorder dates, it make the library doing unintended data manipulation. Make it less reliable in my opinion. I suggest to add an option something like "strict=False" or "fail_safe=True" which allow to skip events with this kind of failures. This one and others that can occur during parsing. It this vision I think we can start by replacing all assert calls by exceptions. I'm preparing a PR to do this. |
I saw it: #134. Good idea!
Often, such calendars have a human viewable form like a month-table/calendar view e.g. where you can enter events. I wonder what that looks like for this specific event. This library would ideally return the expected same result as the frontend would show. The Open Web Calendar uses recurring-ical-events. Thus, if the Open Web Calendar would produce the same view as Sogo does, that would be ideal! |
Cool, thanks! Debut means start, I think, and Au means end... It seems like in the calendar, they do not enforce START <= END. That might have reasons.
So, I would say: On the calendar it looks like the event starts at 23:30, ends at 23:45. Start and end are reversed. This is a case that is forbidden by the RFC. These would be the steps I propose:
This way, users of this library can input a Sogo calendar and not wonder about this special case and enjoy getting the result the calendar shows. |
I didn't make it clear that I didn't figure out how such an event was created with the interface. I don't know how that happened. I can't repeat the bug. |
I will do a PR for swap start/end. |
Describe the bug
Some calendars in the wild contain events with end datetime before start datetime.
(Seen with Sogo as calendar provider)
It make the library crash because of an assertion in Repetition.init ensuring the good order.
ICS file
Workaround
Currently, I have to monkey patch
Repetiton
class to override init method to invert start stop when needed (it is ok for what I need, but may not be suitable for others app use-cases)Version:
Suggested implementation
Maybe it should be nice to offer a proper way to customize the library. For example, allow to passe custom classes to replace the default ones.
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.
The text was updated successfully, but these errors were encountered: