Skip to content

[ical4j 4.x] Update event handlers part1#237

Draft
sunkup wants to merge 25 commits intomainfrom
235-ical4j-4x-update-event-handlers-part1
Draft

[ical4j 4.x] Update event handlers part1#237
sunkup wants to merge 25 commits intomainfrom
235-ical4j-4x-update-event-handlers-part1

Conversation

@sunkup
Copy link
Member

@sunkup sunkup commented Mar 17, 2026

No description provided.

rfc2822 and others added 19 commits March 4, 2026 12:38
* Update ical4j dependency

* Make at.bitfire.ical4android package compile again

* Make package at.bitfire.synctools.icalendar compile again

* Make at.bitfire.synctools compile again (add TODOs)

* Make at.bitfire.ical4android unit tests run again

* Make event builder tests run again

* Make remaining unit tests compile again
* Update CalendarUidSplitter to support ical4j 4.x

* Remove ignore annotation

* Improve kdoc

* Change Instant to LocalDate
Migrate `ICalendarGenerator` and `ICalendarParser` to ical4j 4.x
* Handle empty timezones in `AndroidCompatTimeZoneRegistry` (#203)

* Handle empty timezones

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Just check for empty timezones

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Add clarifying comment

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

---------

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Update minSdkVersion to 24 and remove deprecated code (#204)

* Update minSdkVersion

* - Replace deprecated `closeCompat()` with standard `close()`
- Remove compatibility method `closeCompat()` from `MiscUtils`

---------

Co-authored-by: cketti <ck@cketti.de>

* [ical4j 4.x] Update event validators

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Remove UTC validation rule

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Fix test

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Implement helper

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Throw original exception

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

---------

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
Co-authored-by: cketti <ck@cketti.de>
* Update ICalendar.vAlarmToMin()

* Update ICalendar.timezoneDefToTzId()

* Update ICalendar.fromReader()

# Conflicts:
#	lib/src/main/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessor.kt

* Remove CreatedPropertyRule

� Conflicts:
�	lib/src/main/kotlin/at/bitfire/synctools/icalendar/validation/ICalPreprocessor.kt

* Typo
* Enable `DescriptionBuilderTest`
* Enable `LocationBuilderTest`
* Enable `SequenceBuilderTest`
* Enable `TitleBuilderTest`
* Enable `UrlBuilderTest`
* Migrate `AccessLevelBuilder`
* Migrate `AllDayBuilder`
* Migrate `AttendeesBuilder`
* Migrate `AvailabilityBuilder`
* Migrate `CategoriesBuilder`
* Migrate `ColorBuilder`
* Migrate `OrganizerBuilder`
* Migrate `RemindersBuilder`
* Migrate `StatusBuilder`
* Migrate `UidBuilder`
* Migrate `UnknownPropertiesBuilder`
* Add DatePropertyTzMapper to normalize ical4j timezones to system timezones

* Deprecate timezone utilities in favor of DatePropertyTzMapper

* Make systemTzId visible for testing and add unit tests

* Remove deprecated AndroidTimeUtils tests for ical4j 4.x compatibility

* Refactor DatePropertyTzMapper to handle OffsetDateTime and improve normalization

- Convert OffsetDateTime to Instant for UTC timestamps
- Extract ZonedDateTime normalization logic into separate method
- Add tests for Instant, LocalDate, and OffsetDateTime handling
- Improve documentation and method signatures

* Fix DatePropertyTzMapperTest to use system default timezone

* Add DefaultTimezoneRule for consistent timezone testing and improve systemTzId matching

- Introduce `DefaultTimezoneRule` to set default timezone during tests
- Update `DatePropertyTzMapperTest` to use the new rule
- Refine `systemTzId` matching logic to be case-sensitive
- Add tests for partial timezone ID matches
- Clean up unused imports in `AndroidTimeUtils` and `DatePropertyTzMapper`

* Update AndroidTimeUtils deprecation with ReplaceWith annotation

* Add comment for DefaultTimezoneRule

* Remove misleading KDoc from DefaultTimezoneRule
* Add logging for timezone normalization mismatches

- Log warning when normalized ZonedDateTime has different timestamp than original
- Add test case for TZID known to system but with different VTIMEZONE
- Improve error message for unknown timezone cases

* Update DatePropertyTzMapperTest to use explicit timezone assertions

- Replace generic timezone assertions with specific ZonedDateTime comparisons
- Change test timezone from Europe/Vienna to Europe/Berlin for consistency
- Update DTSTART TZID in test iCalendar data to match new timezone
* Update tasks mapping for ical4j 4.x

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Remove TODO

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Typos

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Fix missing annotation

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* [wip] fix tests for androidifyTimeZone (date)

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Rollback

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* bis-Rollback

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Change implementation

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Update implementation

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Update DmfsTaskTest

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Add DatePropertyTzMapper to normalize ical4j timezones to system timezones

* Deprecate timezone utilities in favor of DatePropertyTzMapper

* Make systemTzId visible for testing and add unit tests

* Remove deprecated AndroidTimeUtils tests for ical4j 4.x compatibility

* Refactor DatePropertyTzMapper to handle OffsetDateTime and improve normalization

- Convert OffsetDateTime to Instant for UTC timestamps
- Extract ZonedDateTime normalization logic into separate method
- Add tests for Instant, LocalDate, and OffsetDateTime handling
- Improve documentation and method signatures

* Fix DatePropertyTzMapperTest to use system default timezone

* Implement recurrenceSetsToOpenTasksString

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Missing import

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Fix comments

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

---------

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* Migrate `StartTimeBuilder`
* Migrate `EndTimeBuilder`
* [WIP] Refactor timezone handling in ICalendarGenerator

- Rename `usedTimeZones` to `usedTimezoneIds` and change type from `Set<ZoneId>` to `Set<String>`
- Update `timeZonesOf()` to extract TZID parameters instead of ZoneId from ZonedDateTime
- Add recursive processing of subcomponents in `timeZonesOf()`
- Add TODO comments for future improvements
- Remove unused `toZonedDateTime()` helper function
- Update imports and add `@VisibleForTesting` annotation
- Add TODO comment in test file for missing tests

* Remove AndroidCompatTimeZoneRegistry and related test files

- Delete AndroidCompatTimeZoneRegistry implementation and factory
- Remove AndroidCompatTimeZoneRegistryTest and Ical4jConfigurationTest
- Update ical4j.properties to remove custom timezone registry
- Remove ProGuard rules for AndroidCompatTimeZoneRegistry

* Preserve original Android timezone IDs in iCalendar output

- Add test case for Europe/Kiev timezone handling
- Ensure VTIMEZONE TZID matches original Android timezone ID
- Add logging for timezone ID mismatches between Android and ical4j
- Update imports and add logger to ICalendarGenerator

* Improve timezone handling in ICalendarGenerator

- Add `copyVTimeZone` method to safely modify VTIMEZONE without affecting registry cache
- Replace direct timezone modification with copy-based approach
- Add test for `copyVTimeZone` to verify property list and observances isolation
- Update timezone ID replacement test to use regex pattern matching
- Add imports for new functionality

* Add tests for `timeZonesOf` method in ICalendarGenerator

- Implement tests for extracting TZIDs from date properties
- Add test for empty result when no TZIDs present
- Include test for TZID extraction from subcomponents
- Add test for empty component case
- Remove unused helper function `toZonedDateTime`

* Add VTimeZoneMinifier class and move minifyVTimeZone logic

- Introduce new `VTimeZoneMinifier` class with dedicated minification logic
- Move `minifyVTimeZone` method from `ICalendar` to new class
- Add comprehensive tests for `VTimeZoneMinifier` functionality
- Remove now redundant test cases from `ICalendarTest`
- Clean up imports and unused helper functions

* Refactor VTimeZoneMinifier to support Temporal types

- Rename `minifyVTimeZone` to `minify` and change parameter type from `ZonedDateTime?` to `Temporal?`
- Add `asZonedDateTime` helper function to convert various Temporal types to ZonedDateTime
- Update all test cases to use new method name and handle nullable start time
- Fix typo in test comment
- Integrate minifier into ICalendarGenerator

* Improve VTimeZoneMinifier robustness and timezone handling

- Enhance `minify` method to handle timezone conversion more robustly
- Add fallback to system default timezone when original TZID is invalid
- Remove redundant null checks and simplify logic flow
- Fix test function name formatting
- Update documentation to reflect parameter name changes
- Clean up code comments and remove outdated TODOs
- Add null safety for timezone registry lookups
- Improve error handling in timezone minification validation
-
@sunkup sunkup linked an issue Mar 17, 2026 that may be closed by this pull request
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ical4j 4.x] Update event handlers part1

4 participants