fix(caldav): do not update dates of tasks when repositioning them #1605

Merged
konrad merged 2 commits from zewaren/api:fix/caldav-etag-dates into main 2023-09-27 16:17:54 +00:00
Contributor

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.

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.
zewaren added 1 commit 2023-09-17 15:35:48 +00:00
continuous-integration/drone/pr Build is passing Details
4f55099896
fix(caldav): do not update dates of tasks when repositioning them
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.
konrad reviewed 2023-09-17 15:47:26 +00:00
@ -1083,6 +1083,7 @@ func recalculateTaskKanbanPositions(s *xorm.Session, bucketID int64) (err error)
_, err = s.Cols("kanban_position").
Where("id = ?", task.ID).
NoAutoTime().
Owner

Can you add a comment here describing why we don't want to update the timestamps?

Can you add a comment here describing why we don't want to update the timestamps?
Author
Contributor

Comment added 👍

Comment added 👍
Owner

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.

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.
zewaren added 1 commit 2023-09-17 16:42:30 +00:00
continuous-integration/drone/pr Build is passing Details
49a790fdad
fix(docs): explain why we use NoAutoTime().
Add a comment explaining why we use NoAutoTime() when synchronizing
the positions of tasks in a bucket/project.
Author
Contributor

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).

> 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).
konrad merged commit feacbbff74 into main 2023-09-27 16:17:54 +00:00
konrad deleted branch fix/caldav-etag-dates 2023-09-27 16:17:54 +00:00
Owner

Thanks!

Thanks!
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1605
No description provided.