Read/write events as EventAndExceptions data object#45
Conversation
…tAndExceptions.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Basically ready, but I will have another look when DAVx5 4.5.3 is released |
… separate class (decorator)
1d7f950 to
ad80101
Compare
d4ea1ca to
daf8e93
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Android calendar event handling system by introducing the EventAndExceptions data object pattern. The goal is to cleanly separate data mapping from storage operations and ensure one-to-one mapping between CalDAV storage objects and local data objects.
Key changes:
- Introduced
EventAndExceptionsdata object for local storage containing main events and exceptions - Created
LegacyAndroidEventBuilder2to generate data objects instead of batch operations - Added
AndroidRecurringCalendarfor CRUD operations on events with exceptions - Removed deprecated
AndroidEventclass
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| EventAndExceptions.kt | New data class representing main event and its exceptions |
| AndroidRecurringCalendar.kt | New class handling CRUD operations for events with exceptions |
| LegacyAndroidEventBuilder2.kt | Refactored builder to generate data objects instead of batch operations |
| AndroidCalendar.kt | Enhanced with batch operation support and entity-based methods |
| Test files | Updated tests to work with new data object pattern |
Comments suppressed due to low confidence (1)
lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/LegacyAndroidEventBuilder2.kt:63
- [nitpick] The class name 'LegacyAndroidEventBuilder2' suggests this is a temporary naming scheme. Consider using a more descriptive name like 'AndroidEventDataBuilder' or 'EventAndExceptionsBuilder' to better reflect its purpose.
class LegacyAndroidEventBuilder2(
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidRecurringCalendar.kt
Outdated
Show resolved
Hide resolved
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidRecurringCalendar.kt
Show resolved
Hide resolved
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidRecurringCalendar.kt
Show resolved
Hide resolved
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendar.kt
Show resolved
Hide resolved
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidCalendar.kt
Show resolved
Hide resolved
daf8e93 to
03f333a
Compare
…tent provider access in LegacyAndroidEventProcessor anymore)
|
I understand that this is hard to review … but maybe you see something that looks really strange to you @sunkup |
sunkup
left a comment
There was a problem hiding this comment.
Yes well, we talked about it twice already and the structural changes are really nice improvement. I don't see any major issues in the code, but there are two small things that I don't understand entirely and would love to hear some clarification on.
To be merged for bitfireAT/davx5-ose#1605 / DAVx5 4.5.4
EventAndExceptionsdata object for local storage that contains a main event and optional exceptions for it (not to be confused with anEntitythat comprises a main event row and its data rows, or withAssociatedEventsthat is in iCalendar level, not on local storage level)LegacyAndroidEventBuilderwhich generated aBatchOperation(operation) rewritten toLegacyAndroidEventBuilder2that generates aEventAndExceptionsobject (data object, doesn't contain operations and thus can be tested much easier)AndroidEventremovedAndroidRecurringCalendarprovides CRUD forEventAndExceptionsThe big goal is that
AssociatedEvents) can be mapped to exactly one data object (EventAndExceptions) and vice versa,