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

JtxCollection: Add CRUD operations for JtxICalObject#397

Merged
sunkup merged 4 commits into
mainfrom
394-jtxcollection-manage-crud-the-actual-items
May 19, 2026
Merged

JtxCollection: Add CRUD operations for JtxICalObject#397
sunkup merged 4 commits into
mainfrom
394-jtxcollection-manage-crud-the-actual-items

Conversation

@sunkup
Copy link
Copy Markdown
Member

@sunkup sunkup commented May 18, 2026

Purpose

Add comprehensive create, read, update, and delete operations for managing JtxICalObject items (vtodo, vjournal) within jtx collections.

Short description

  • Add methods for inserting objects: addJtxObject() with batch support
  • Add query methods: countJtxObjects(), findJtxObject(), findJtxObjects(), getJtxObject(), getJtxObjectRow()
  • Add iteration methods: iterateJtxObjects(), iterateJtxObjectRows()
  • Add update methods: updateJtxObject(), updateJtxObjectRow(), updateJtxObjectRows() with batch support
  • Add delete methods: deleteJtxObject() with batch support and cascade deletion of sub-rows
  • Properly handle Entity objects with sub-rows (attendees, categories, alarms, etc.)
  • Include helper methods for batch operations and collection isolation
  • Add comprehensive test coverage in JtxCollectionTest.kt

Note

For reviewing it might be interesting to compare with AndroidCalendar.kt. Notice that the workaround for the calendarprovider bug addressed in AndroidCalendar.kt is of course not needed for JtxBoard.

@sunkup sunkup linked an issue May 18, 2026 that may be closed by this pull request
@sunkup sunkup requested a review from Copilot May 18, 2026 13:20
@sunkup sunkup changed the title Add CRUD operations for JtxICalObject to JtxCollection JtxCollection: Add CRUD operations for JtxICalObject May 18, 2026
Copy link
Copy Markdown
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

Adds first-class CRUD support for jtx Board JtxICalObject items within JtxCollection, including entity (main row + sub-rows) handling and a comprehensive Android instrumentation test suite to validate behavior.

Changes:

  • Implemented insert/query/iterate/update/delete APIs for jtx objects, supporting both ContentValues (main row only) and Entity (main row + sub-rows).
  • Added helper utilities for collection-scoped selection building and for loading sub-rows into Entity.
  • Added Android instrumentation tests covering CRUD flows, batching, cascade deletion, and collection isolation.

Reviewed changes

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

File Description
lib/src/main/kotlin/at/bitfire/synctools/storage/jtx/JtxCollection.kt Adds CRUD APIs for JtxICalObject plus helper methods/constants for scoping queries and handling sub-rows.
lib/src/androidTest/kotlin/at/bitfire/synctools/storage/jtx/JtxCollectionTest.kt New instrumentation tests validating the new CRUD behavior (including batch ops and sub-row handling).

Comment thread lib/src/main/kotlin/at/bitfire/synctools/storage/jtx/JtxCollection.kt Outdated
Comment thread lib/src/main/kotlin/at/bitfire/synctools/storage/jtx/JtxCollection.kt Outdated
@sunkup sunkup self-assigned this May 18, 2026
@sunkup sunkup added the refactoring Quality improvement of existing functions label May 18, 2026
@sunkup sunkup requested a review from cketti May 18, 2026 13:29
@sunkup sunkup marked this pull request as ready for review May 18, 2026 13:30
Copy link
Copy Markdown
Contributor

@cketti cketti left a comment

Choose a reason for hiding this comment

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

👍

Comment thread lib/src/androidTest/kotlin/at/bitfire/synctools/storage/jtx/JtxCollectionTest.kt Outdated
@sunkup sunkup merged commit 5d5e88c into main May 19, 2026
9 checks passed
@sunkup sunkup deleted the 394-jtxcollection-manage-crud-the-actual-items branch May 19, 2026 08:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JtxCollection: manage (CRUD) the actual items

3 participants