-
Notifications
You must be signed in to change notification settings - Fork 3
Introduce mapping classes #32
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
Conversation
33435b1 to
a937e5d
Compare
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.
Pull Request Overview
This PR extracts the event build and populate logic out of AndroidEvent into two focused mapping classes, improving separation of concerns without altering existing behavior.
- Introduce
AndroidEventProcessorfor reading Android provider rows intoEvent. - Introduce
AndroidEventBuilderfor writing anEventback to Android provider rows. - Refactor
AndroidEventto delegate to these new classes and remove inline mapping code; update package and imports inAttendeeMappings.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| AttendeeMappings.kt | Updated package, docs, and simplified getParameter calls. |
| AndroidEventProcessor.kt | Added new class handling populate logic from provider rows. |
| AndroidEventBuilder.kt | Added new class handling build logic into provider rows. |
| AndroidEvent.kt | Refactored to delegate to builder/processor classes, removed inline mapping code. |
| AttendeeMappingsTest.kt | Updated package declaration and reformatted assertions. |
| AndroidEventProcessorTest.kt | Moved tests to new mapping package; no logic changes. |
Comments suppressed due to low confidence (3)
lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventBuilder.kt:1
- [nitpick] There are thorough tests for
AndroidEventProcessor, but no dedicated unit tests forAndroidEventBuilder. Adding coverage for builder code paths—especially around recurrence rules, exceptions, and extended properties—would help ensure correctness during future refactors.
/*
lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AttendeeMappings.kt:20
- [nitpick] The reference
[Attendees]can be ambiguous in generated docs. Consider using a fully qualified link, e.g.[CalendarContract.Attendees], or importing it explicitly so readers know exactly which API is being mapped.
* Defines mappings between Android [Attendees] and iCalendar parameters.
lib/src/main/kotlin/at/bitfire/synctools/mapping/calendar/AndroidEventBuilder.kt:304
- This mutates the original
event.rDateslist, which may cause unexpected side effects if the sameEventinstance is reused. Consider operating on a copy of the recurrence list or using a local temporary list before building the Android row.
event.rDates.addFirst(RDate(listWithDtStart))
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.
Hmm. Why are 12 tests failing when there has been no logic changes, but only rearrangements and slight additions? Since you requested the review with failing tests, will the tests be fixed in a new PR then? I think we should keep everything in a working state. Or is that not possible?
be2b19d to
ce46844
Compare
Looks like it was caused by the shared time zone registry in |
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.
Did the force push remove the previous commits from ths PR? The top comment talks about changes that are not present (anymore)? Or have those changes been merged into the main branch already?
|
This PR/issue depends on: |
1 similar comment
|
This PR/issue depends on: |
5c5939e to
c90aa10
Compare
sunkup
left a comment
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.
Looks ok
Depends on #36
This PR extracts Event builder (
build…) and processor (populate…) logic to dedicated classes, without changing the logic itself.The interesting part happens in
AndroidEvent. The populate/build methods are only slightly adapted, for instance by introducing ato: Eventargument forpopulate. The logic of building/populated has not been touched.The huge number of lines comes from moving the methods and the tests.
PS: Changed some tests to become more independent of each other, for instance by using the class name in test accounts.