This repository was archived by the owner on May 26, 2026. It is now read-only.
Refactor tasks (tasks.org/OpenTasks) to separate layers for storage + mapping #116
Copy link
Copy link
Closed as duplicate
Task
5 / 115 of 11 issues completed
Copy link
Labels
refactoringQuality improvement of existing functionsQuality improvement of existing functionstasksRegarding tasks / everything that's stored in a task app providerRegarding tasks / everything that's stored in a task app provider
Description
See also: https://github.com/bitfireAT/davx5/issues/670
We can use the new event architecture (at.bitfire.synctools.{icalendar,mapping.calendar,storage.calendar}) as a template.
Done when:
- Storage, mapping and iCalendar access are separated
- No separate data class (
Task) required anymore - Storage API is in
at.bitfire.synctools.storage.taskspackage- Collection (similar to calendar): task list
- Are exceptions of recurring tasks supported? If yes, we need additional classes
- Investigated by Find out supported features of OpenTasks and tasks.org #374 (see there for details)
- Item: task, stored in
Entitythat represents rows in task provider
- Mapping API is in
at.bitfire.synctools.mapping.taskspackage - iCalendar API is in
at.bitfire.synctools.icalendarpackage - All classes have proper tests
Issues + PRs
-
Like LocalCalendar/LocalEvent: provide all fields for DAVx5 #15
-
Like Move logic from
AndroidCalendarcompanion object toAndroidCalendarProvider#28 -
Like refactor
AndroidEvent; introduceAndroidEvent2withEntityas data object #40 -
Like Read/write events as
EventAndExceptionsdata object #45 -
Like More builders #71
-
Like More processors #79
-
Like Refactor remaining field processing into dedicated processors #81
-
Like Only generate recurrence fields/properties for recurring main events #89
-
Like Ignore recurrence rules whose UNTIL is on or before DTSTART #95
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
refactoringQuality improvement of existing functionsQuality improvement of existing functionstasksRegarding tasks / everything that's stored in a task app providerRegarding tasks / everything that's stored in a task app provider
Activity
[-]Refactor tasks to separate layers for storage + mapping[/-][+]Refactor tasks (tasks.org/OpenTasks) to separate layers for storage + mapping[/+]sunkup commentedon May 5, 2026
In order to finish the remaining task refactoring I asked AI to come up with a meta issue description and a list of sub-issues, preferably to be worked on in parallel, which I tried to analyse and play through in my head. I think it makes sense, but I am also still inexperienced in planning multiple refactoring issues ahead, so maybe there is room for improvement with this plan? ( @rfc2822 ) It assumes #182 will be finished (first sub-issue).
General idea:
The builder/handler issue splits are supposed to be designed so several of them can be worked on in parallel.
List of issues
synctools task refactor issue drafts
These issue drafts split the remaining work from
synctools#116into smaller, parallelizable units.Assumption used here: include the current WIP
synctools#182as issue 1.Common labels to apply:
refactoring,tasksMeta issue: Complete the remaining task refactor analog to events
Replaces
synctools#116to track work needed to finish splitting task storage access from task mapping/business logic, analogous to the event architecture already present in synctools.DmfsTaskstorage APITaskmapping into dedicated field handlersTaskmapping out of storage-levelDmfsTaskDmfsTaskcompatibility APIsIssue 1: Finalize entity-based
DmfsTaskstorage APIDepends on: none
Parallel work: none; foundation issue
Description
Finalize the
storage.tasks.DmfsTaskwork currently explored insynctools#182so it becomes the canonical storage-level task object. The storage object should be backed byEntitydata from the provider and should define a clear compatibility boundary to the deprecated legacyat.bitfire.ical4android.DmfsTask.Scope
storage.tasks.DmfsTaskAPI shapeAcceptance criteria
storage.tasks.DmfsTaskis available as the canonical storage task typeIssue 2: Introduce task field-builder and field-handler extension points
Depends on: Issue 1
Parallel work: unlocks Issues 3-7
Description
Introduce task equivalents of the event builder/handler interfaces so
DmfsTaskBuilderandDmfsTaskProcessorbecome orchestration layers instead of monolithic classes. This issue should not intentionally change behavior.Scope
DmfsTaskBuilderandDmfsTaskProcessorto compose these interfacesAcceptance criteria
DmfsTaskBuilderno longer needs to own all field logic directlyDmfsTaskProcessorno longer needs to own all field logic directlyIssue 3: Split task main-row builder into dedicated field builders
Depends on: Issue 2
Parallel work: can run in parallel with Issues 4 and 5
Description
Extract the non-time, non-property writes from
DmfsTaskBuilder.buildTask()into focused builder classes so the main task row is assembled from small, testable components.Scope
Acceptance criteria
DmfsTaskBuilder.buildTask()is reduced to orchestrationIssue 4: Split task time and recurrence builder logic
Depends on: Issue 2
Parallel work: can run in parallel with Issues 3 and 5
Description
Extract all time-related and recurrence-related write logic from
DmfsTaskBuilderinto dedicated builders and helpers, analogous to the event-side split of start/end/duration/recurrence handling.Scope
DTSTARTDUEDURATIONRDATERRULEEXDATEAcceptance criteria
buildTask()Issue 5: Split task property builders for alarms, categories, comments, relations, and unknown properties
Depends on: Issue 2
Parallel work: can run in parallel with Issues 3 and 4
Description
Replace the
insert...methods inDmfsTaskBuilderwith dedicated property builder classes, following the pattern already used by event sub-row builders.Scope
TasksBatchOperationbehaviorAcceptance criteria
insertProperties()delegates to dedicated builder classesIssue 6: Split task row-to-
Taskmapping into dedicated field handlersDepends on: Issue 2
Parallel work: can run in parallel with Issue 7 and partly with Issues 3-5
Description
Extract the non-time, non-property reads from
DmfsTaskProcessor.populateTask()into focused handler classes so provider-row-to-Taskmapping becomes composable and easier to maintain.Scope
Taskoutput behavior unchangedAcceptance criteria
populateTask()becomes a small orchestration methodIssue 7: Split task time, recurrence, and property mapping handlers
Depends on: Issue 2
Parallel work: can run in parallel with Issue 6
Description
Extract the remaining time, recurrence, and property parsing logic from
DmfsTaskProcessorinto dedicated handlers and helper utilities.Scope
DTSTARTDUEDURATIONAcceptance criteria
DmfsTaskProcessorno longer directly implements all parsing logicIssue 8: Move
Taskmapping out of storage-levelDmfsTaskDepends on: Issues 3, 4, 5, 6, 7
Parallel work: none; integration step
Description
Once the mapper pieces are split, remove the remaining storage/mapping mixing from
storage.tasks.DmfsTask. Storage should deal with provider entities and CRUD, while conversion to/fromat.bitfire.ical4android.Taskshould happen in dedicated mapper composition.Scope
DmfsTaskTaskconversion behind explicit mapper compositionAcceptance criteria
DmfsTaskno longer owns mixed storage + mapping behaviorTaskconversion is delegated to explicit mapper compositionIssue 9: Remove deprecated legacy
DmfsTaskcompatibility APIsDepends on: Issue 8
Parallel work: none; cleanup/finalization
Description
Remove the temporary compatibility bridge once DAVx5 and tests use the new storage-level and mapper-based APIs.
Scope
at.bitfire.ical4android.DmfsTaskDmfsTaskList.getLegacyTaskAcceptance criteria
Suggested execution order
rfc2822 commentedon May 6, 2026
Sounds good to me! I'd however leave the parallelization away and focus on the working main branch after every PR. If we want to use AI for the tasks, the parallelization is not needed anyway because the PRs will be generated quickly and then the bottleneck is the manual verification.
So I'd:
4 remaining items
rfc2822 commentedon May 26, 2026
Call needed to get common understanding – what has already been done, what is missing, re-evaluate
rfc2822 commentedon May 26, 2026
Moved to bitfireAT/davx5-ose#2264. We want to analyze the current state / goal again and then create the respective sub-issues in the new issue.