fix(caldav): do not update dates of tasks when repositioning them #1605
No reviewers
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#1605
Loading…
Reference in New Issue
No description provided.
Delete Branch "zewaren/api:fix/caldav-etag-dates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a task is updated, the position of the tasks of the whole
project/bucket are updated. This leads to column "updated" of
model Task to be updated quite often.
However, that column is used for the ETag field of CALDAV.
Thus, changing a task marks all the other tasks as updated, which
prevents clients from synchronizing their edited tasks.
@ -1083,6 +1083,7 @@ func recalculateTaskKanbanPositions(s *xorm.Session, bucketID int64) (err error)
_, err = s.Cols("kanban_position").
Where("id = ?", task.ID).
NoAutoTime().
Can you add a comment here describing why we don't want to update the timestamps?
Comment added 👍
Looks good overall, but this won't prevent changed etags of tasks which are dragged via the kanban board or task list. Only when the position of all tasks in a bucket/project are recalculated.
I suggest fixing the case where people actually move tasks in the web interface later. It's going to take a lot more effort in the code.
The MR in its state new fixes the most important problem: only the first task from a caldav client is able to be updated, and all other changes are discarded (since the new date of all tasks becomes more recent on the server).
Thanks!