-
Notifications
You must be signed in to change notification settings - Fork 233
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
Keep apart VEVENT.DTEND
and .DURATION
#598
Keep apart VEVENT.DTEND
and .DURATION
#598
Conversation
Yes, I saw these calculations when reviewing the code for the v4.3 release. Following RFC 5545 is clearly the preferred way to go. We can expect more breaking changes, so we could also consider a temporary flag like v4-compatibility-enabled. This could be introduced at any time, and all new code could have RFC compliance in focus. v5 could then switch compatibility == false by default. What do you think? There will be a new major version anyway, as soon as the project is migrated to NRT enabled. I can't foresee yet, how much time this will require and how much risks this will bring because of low code coverage in some areas. |
Yes, a temporary flag would certainly be an option. Where would we put it? But on the other hand, this would introduce quite some additional complexity to the code and require a considerable amount of additional testing. As you intend to introduce a v5 soon anyways, it might also be a good idea to start collecting those breaking changes from now on. Similar code is contained in Period.cs, which seems to be related to #564 and should be improved as well. Keeping everything backwards-compatible might not be worth the effort. |
c387516
to
5951a3c
Compare
Quality Gate passedIssues Measures |
To setup a project and a new v5 branch looks like the way to go, I agree. |
@axunonb While rebasing this PR I stumbled across following change, because the affected test fails now https://github.com/ical-org/ical.net/pull/620/files#r1807942277 The problem is that cloning of the calendar events normalizes the we create a copy of the Uri by applying a pattern of the form Previously the calendar has always been copied during serialization due to the fact, that The question is now, what the expected behavior would be. From my perspective copying should not have any side effects, so we should just copy the reference to the URI rather than cloning the URI itself. Copying the reference is safe, as Uri is immutable. The question is, whether an implicit conversion from lower to upper-case should happen or not. In this case I'd say its the responsibility of the caller to provide clean input. I'd generally recommend keeping the original input rather than applying sanitization. |
agree
agree I remember this failing test, and obviously I was not diving deep enough. Thanks! |
5951a3c
to
36a21b8
Compare
3a159f5
to
7a06e52
Compare
…DtEnd` and `Duration`. Doesn't seem to be a realistic case and prevents us from dealing with subtle differences between `DTEND` and `DURATION`.
…tually exclusive according to RFC 5545.
…ly calculate the duration on the fly when needed. This way we don't overwrite the information, which of both was originally set and can adjust calculations accordingly (in the future). See ical-org#574.
… is fixed with this PR.
7a06e52
to
7aeecbc
Compare
Quality Gate passedIssues Measures |
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.
Love it, no more ExtrapolateTimes
, thanks!
There is a new branch version/v5
where this PR should get merged.
Fixes #574
Fixes #629
According to RFC 5545
VEVENT
's propertiesDTEND
andDURATION
cannot be calculated from each other, because the evaluation rules are slightly different. The previous implementation ofCalendarEvent
extrapolated both values based on each other, and as a consequence remove the information, which of both was originally specified.With this PR the extrapolation only happens on the fly when needed but only the originally specified property is stored. The additional information is not used for any calculations so far, but can in the future.
DISCUSS: This is a breaking change, as uses might expect DtEnd to be calculated from Duration and vice versa. An alternative would be to keep the behavior of the properties as is but calculate fallback on the fly when needed rather than upfront. That way the
CalendarEvent.DtEnd
and.Duration
properties would behave as before but the serialized versions might still be slightly different. However, the behavior would be less transparent and potentially confuse new users. TBD