Conversation
* 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 -
* Migrate `OriginalInstanceTimeBuilder` * Migrate `DurationBuilder` * Migrate `RecurrenceFieldsBuilder`
* Migrate `AvailabilityHandler` * Migrate `StatusHandler` * Migrate `SequenceHandler` * Migrate `OrganizerHandler` * Migrate `AttendeesHandler` * Migrate `CategoriesHandler` * Migrate `UnknownPropertiesHandler` * Migrate `UrlHandler` * Migrate `RemindersHandler`
* [WIP] Migrate `AndroidTimeUtils.androidStringToRecurrenceSet()` * Migrate AndroidTimeUtils.androidStringToRecurrenceSet and tests * Add necessary property parameters in `AndroidTimeUtils.androidStringToRecurrenceSet()` * Refactor (address review comment) --------- Co-authored-by: cketti <ck@cketti.de>
* Migrate `TaskWriter` * Migrate `TaskReader`
* Update UidHandler and tests * Update OriginalInstanceTimeHandler and tests * Update TitleHandler and tests * Update LocationHandler and tests * Update StartTimeHandler and tests * Update EndTimeHandler and tests * Update DurationHandler and tests * Update DescriptionHandler and tests * Update ColorHandler and tests * Update AccessLevelHandler and tests * Minor changes
…igration (#257) * Re-enable `AndroidTimeZonesTest` * Migrate `Ical4jServiceLoaderTest` * Migrate `TaskTest` * Migrate `UnknownPropertyTest` * Migrate `AssociatedComponentsTest` * Migrate `DateUtilsTest` * Migrate `Ical4jTest` * Migrate `AndroidTimeFieldTest` and fix `AndroidTimeField`
* Remove unused imports * Remove unused `AndroidTimeField.asIcal4jDate()` * Remove unused `TimeZoneRegistry` parameter from `AndroidTimeField` * Remove unused functions from `TimeApiExtensions` * Remove unused functions from `AndroidTimeUtils` * Remove unused functions from `DateUtils`
* Remove `Instant.toLocalDate()` from `DateUtils` Use the more generic `Temporal.toLocalDate()` from `TimeApiExtensions` instead. * Remove `Temporal.toEpochMilli` from `DateUtils` Use `Temporal.toTimestamp()` from `AndroidTemporalMapper` instead. This function retains ical4j's old behavior when it comes to converting floating DATE and DATE-TIME values to a timestamp. * Move functions from `AndroidTemporalMapper` to `AndroidTimeUtils`
* Fix JtxICalObject update mistakes * Minor changes and comments * Fix helpers after rebase * Rename variable * Use Temporal.toTimestamp() from AndroidTimeUtils and remove Temporal.toEpochMilli again * Minor changes
This fixes `JtxSyncManagerTest.testProcessICalObject_addsRecurringVtodo_withoutDtStart` in davx5-ose
…lify temporal conversion logic (#310) * Add Temporal.toInstant(), simplify Temporal conversion and improve exception handling * Replace `Instant.ofEpochMilli(toTimestamp())` with `toInstant()` for cleaner temporal conversions * Simplify recurrence date conversion logic and improve code readability * Refactor `androidTimezoneId()` to use `when` expression and improve readability * Simplify `androidTimezoneId()` test by using `@Test(expected)` and remove empty lines * Clarify recurrence date handling for non-all-day events with DATE RDATE/EXDATE * Handle DATE RDATE/EXDATE in all-day events with DATE-TIME DTSTART * Revert AndroidTimeUtilsTest changes
Calculations with `start` and `end` were failing with `LocalDate` instances.
* Add logic to wait for `LAST_DATE` to be available in Calendar Provider * Remove `InitCalendarProviderRule` and replace with direct permission rules - Delete `InitCalendarProviderRule.kt` as it's no longer needed - Replace `InitCalendarProviderRule.initialize()` with `GrantPermissionRule.grant()` - Fix typo in `permissonRule` to `permissionRule` in affected test classes * [WIP] Remove direct instance count checks, use `numInstances()` instead - Always create new test calendar instead of reusing existing one - Add time zone and sync events to test calendar creation - Update all test classes to use new `create()` method - Move test setup/teardown to companion object with `@BeforeClass`/`@AfterClass` - Remove direct instance count checks, use `numInstances()` instead - Add logging for test calendar creation and instance queries - Fix exception handling in recurring event tests * Use `Instant` for test timestamps and add `deleteAllEvents()` helper - Replace `System.currentTimeMillis()` with `Instant`-based timestamps - Add `testStartTime` and `testStartMillis` constants for consistent test timing - Implement `deleteAllEvents()` method for test cleanup - Update recurring event tests to use new helper methods - Fix typo: "cancelled" → "canceled" for consistency * Refactor test setup to use `@BeforeClass`/`@AfterClass` and update recurring event tests - Move test setup/teardown to companion object with `@BeforeClass`/`@AfterClass` - Add `cleanUp()` method to delete events after each test - Update `insertRecurring()` * Refactor test setup to use `@BeforeClass`/`@AfterClass` and add recurring calendar support - Move test setup/teardown to companion object with `@BeforeClass`/`@AfterClass` - Add `recurringCalendar` field and initialize in `setUpClass()` - Add `cleanUp()` method to delete events after each test - Update test account name to use `AndroidCalendarTest::class.java.name` * Improve calendar provider compatibility and instance handling - Clarify Android 12 calendar provider changes in comments - Add note about millisecond precision in Android <= 11 - Simplify event insertion code in `addEvent()` - Add documentation for `deleteAllEvents()` - Improve `numInstances()` documentation and logic - Return main event ID after batch commit in `AndroidRecurringCalendar` * Extract waiting for LAST_DATE into separate method * Improve numInstances() to check SYNC_EVENTS flag before querying instances - Relocate TestCalendar from ical4android.impl to synctools.storage.calendar - Add nowAlignedToSecond() utility method for consistent test timing - Update imports in all affected test classes * Remove debug logging and unused imports from `numInstances()` query * Refactor `numInstances()` to use new `getFirstAndLastTimestamp()` method * Use `Duration` for time calculations in AndroidCalendarTest * Fix minor mistakes * Add behavior tests for SYNC_EVENTS * Add documentation/tests for calendar provider behavior * Make test fields private and improve instance expansion tests - Make test fields private in multiple test classes - Add proper cleanup in `testInstancesExpansionNeedsSyncEvents_syncEventsNotSet()` - Implement `testInstancesExpansionMatchesMillisecondExceptions` with two test cases: - Aligned to second (works on all API levels) - Not aligned to second (works only on newer API levels) - Change `values` visibility from private to internal in `AndroidCalendar` * Minor improvements * Add test for calendar update functionality - Add test case for updating calendar display name - Rename `withExceptionIds` to `getExceptionIds` for clarity - Add SQL injection safety comment in `numInstances()` - Fix parameter name in `update()` from `values` to `newValues` - Update doc comment for `update()` method * Rename test methods and use assertEquals instead of Assert.assertEquals - Rename test methods to use camelCase for consistency - Replace `Assert.assertEquals` with `assertEquals` for better readability
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.
We don't have to use it for davx5 until we're ready.
Important
Use merge commit merging instead of squash merging.