Skip to content

Conversation

@rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Jun 26, 2025

Refactoring: move PRODID to where it belongs

@rfc2822 rfc2822 added the refactoring Quality improvement of existing functions label Jun 26, 2025
@rfc2822 rfc2822 marked this pull request as ready for review June 26, 2025 12:29
@rfc2822 rfc2822 requested a review from Copilot June 26, 2025 12:30
Copy link
Contributor

Copilot AI left a 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 introduces explicit handling of the PRODID property in both vCard and iCalendar generation, replacing reliance on static or default PRODID values with explicit parameters.

  • Explicit PRODID is now passed as a parameter to various write methods.
  • Build configuration and test cases were updated to reflect the new product/project naming and PRODID propagation.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
settings.gradle.kts Updated the root and library project names to reflect the proper project naming.
lib/src/main/kotlin/at/bitfire/vcard4android/ContactWriter.kt Modified the vCard writer to accept an explicit productId and apply it when setting the PRODID property.
lib/src/main/kotlin/at/bitfire/vcard4android/Contact.kt Updated vCard write methods to require a productId parameter rather than relying on a static variable.
lib/src/main/kotlin/at/bitfire/ical4android/Task.kt Changed the write() function to require a prodId parameter and updated how PRODID is added to the calendar.
lib/src/main/kotlin/at/bitfire/ical4android/JtxICalObject.kt Propagated the explicit prodId parameter in calendar conversion and output methods.
lib/src/main/kotlin/at/bitfire/ical4android/JtxCollection.kt Updated ICS collection generation to require and use an explicit prodId.
lib/src/main/kotlin/at/bitfire/ical4android/ICalendar.kt Modified the PRODID extension to properly append user agent information to the passed PRODID.
lib/src/main/kotlin/at/bitfire/ical4android/Event.kt Updated event write() methods to include an explicit prodId for PRODID generation.
Test Files Adjusted all test cases to pass the new explicit product/prod IDs to the write methods.
Comments suppressed due to low confidence (4)

settings.gradle.kts:23

  • Ensure the new root project name 'synctools' is consistent with your repository and organizational naming conventions.
rootProject.name = "synctools"

lib/src/main/kotlin/at/bitfire/vcard4android/ContactWriter.kt:78

  • Confirm that the string formatting for PRODID meets the requirements of your clients and downstream consumers; consider validating the resulting format against the vCard specification.
        vCard.productId = ProductId("$productId (ez-vcard/${Ezvcard.VERSION})")

lib/src/main/kotlin/at/bitfire/vcard4android/Contact.kt:128

  • [nitpick] Consider aligning the PRODID handling between the vCard API (which uses a String) and the iCalendar API (which uses a ProdId type) for consistency in your codebase.
    fun writeJCard(os: OutputStream, productId: String) {

lib/src/androidTest/kotlin/at/bitfire/ical4android/JtxCollectionTest.kt:154

  • Remove the debug print statement before merging to maintain clean test output.
        System.err.println(ics)

@rfc2822 rfc2822 self-assigned this Jun 26, 2025
@rfc2822 rfc2822 merged commit 25404dc into main Jun 26, 2025
10 checks passed
@rfc2822 rfc2822 deleted the prodid branch June 26, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant