Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

[Jtx Board] Adapt to new immutable ical4j.x PropertyList scheme#440

Merged
rfc2822 merged 3 commits into
mainfrom
407-http-415-when-uploading-jtx-board-task-calendar-object-may-only-have-components-with-the-same-uid
May 26, 2026
Merged

[Jtx Board] Adapt to new immutable ical4j.x PropertyList scheme#440
rfc2822 merged 3 commits into
mainfrom
407-http-415-when-uploading-jtx-board-task-calendar-object-may-only-have-components-with-the-same-uid

Conversation

@rfc2822

@rfc2822 rfc2822 commented May 23, 2026

Copy link
Copy Markdown
Member

ical4j 4.x changed its collection types (PropertyList, ComponentList, ParameterList) to be immutable — operations like add() and remove() return a new instance instead of modifying in place:

// ical4j 3.x — mutates in place, works
propertyList.add(prop)

// ical4j 4.x — returns new instance, original unchanged
propertyList = propertyList.add(prop)  // must reassign!

Several places in JtxICalObject.kt were discarding those return values, silently losing data (empty VTODO exceptions → HTTP 415 from server, dropped alarms).

This PR

  • directly creates the VALARM component with the new properties (alarmProps),
  • for exceptions, re-assigns the modified property list.

@rfc2822 rfc2822 added pr-bugfix Fixes something that isn't working (only used for PRs) jtx Board Related to jtx Board labels May 23, 2026
@rfc2822 rfc2822 force-pushed the 407-http-415-when-uploading-jtx-board-task-calendar-object-may-only-have-components-with-the-same-uid branch 2 times, most recently from 7e23594 to e8b581d Compare May 23, 2026 11:27
@rfc2822 rfc2822 force-pushed the 407-http-415-when-uploading-jtx-board-task-calendar-object-may-only-have-components-with-the-same-uid branch from e8b581d to fbd80cb Compare May 23, 2026 11:29
@rfc2822 rfc2822 self-assigned this May 23, 2026
@rfc2822 rfc2822 requested a review from Copilot May 23, 2026 11:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Jtx Board iCalendar generation to work with ical4j 4.x immutable PropertyList behavior, preventing silently dropped exception properties and missing alarm properties when exporting VTODO/VJOURNAL.

Changes:

  • Reworks VALARM construction to build a fresh PropertyList from collected alarm properties.
  • Fixes recurring exception export by re-assigning the modified propertyList onto the exception component.
  • Adds instrumented tests to validate exception UID/RECURRENCE-ID and basic VALARM property presence.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt Adapts alarm and recurrence-exception serialization to immutable ical4j list semantics.
lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt Adds regression tests for exception properties and alarm property generation.

Comment thread lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt
Comment thread lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt
Comment thread lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxICalObjectTest.kt Outdated
@rfc2822 rfc2822 marked this pull request as ready for review May 23, 2026 12:02
@rfc2822 rfc2822 merged commit f9b8b55 into main May 26, 2026
9 checks passed
@rfc2822 rfc2822 deleted the 407-http-415-when-uploading-jtx-board-task-calendar-object-may-only-have-components-with-the-same-uid branch May 26, 2026 12:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

jtx Board Related to jtx Board pr-bugfix Fixes something that isn't working (only used for PRs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP 415 when uploading jtx Board task: calendar object may only have components with the same UID

3 participants