Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR pulls the reading and writing logic out of the Event data class into new EventReader and EventWriter classes, updating all tests to use the new APIs and removing hidden behavior from Event.
- Introduces
EventReader/EventWriterand migrates allEvent.eventsFromReader/Event.writecalls. - Removes read/write methods and companion object from
Event. - Updates unit and instrumentation tests to use the new reader/writer and cleans up legacy code.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| EventValidatorTest.kt | Replaced static reader calls with eventReader.readEvents; added eventReader property. |
| EventWriterTest.kt | New tests validating EventWriter.write output. |
| EventTest.kt (unit tests) | Added tests for Event.toString and organizerEmail accessor. |
| EventReaderTest.kt | Renamed test class, removed legacy code, switched to EventReader.readEvents. |
| EventWriter.kt | New class extracting write logic from Event. |
| EventReader.kt | New class extracting read logic from Event. |
| Event.kt | Stripped out read/write logic and companion object from Event. |
| Ical4jTest.kt (androidTest) | Updated to call EventReader.readEvents. |
lib/src/test/kotlin/at/bitfire/ical4android/validation/EventValidatorTest.kt
Outdated
Show resolved
Hide resolved
This was referenced Jan 29, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Eventis a data class and as such it shouldn't have hidden logic.This PR extracts reading/writing
Events into respective classes.(In a later stage of refactoring, we will be able to completely remove the
Eventclass and map directly between iCalendar ↔ Android data rows.)To be merged for bitfireAT/davx5-ose#1573