mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-12 01:59:34 -05:00
Inconsistent behavior of done_at field in tasks API when updating done status #607
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Originally created by @Plong-Wasin on GitHub (Sep 10, 2025).
Description
There appears to be an inconsistency in the way the
done_atfield is handled by the Vikunja tasks API endpoints (/api/v1/tasks/{id}and/api/v1/tasks/bulk) when updating thedonestatus of a task.Specifically, given a payload like:
and assuming the previous state was
done = false, the following occurs:done_atis set to the current server time instead of the provided timestamp.done_atuses the timestamp from the payload as expected.In another scenario, if the payload contains only:
done_atis set to the current time as expected.done_atinexplicably changes to"0001-01-01T00:00:00Z", which appears to be a default or zero value rather than retaining the previous time or current timestamp.It is unclear whether this behavior is intended or a bug. The expectation would generally be either:
doneis set to true anddone_atis provided, the API should use the provideddone_attimestamp consistently.done_atis omitted, the API should setdone_atto the current timestamp when marking a task done and not revert to a zero time on subsequent updates.Please investigate whether this inconsistent handling of the
done_atfield on task updates is by design or an issue that needs addressing.Steps to reproduce:
{ "done": true, "done_at": "<timestamp>" }from a previously undone state.done_atis set to the current time, not the provided timestamp.done_atuses the provided timestamp.{ "done": true }only from undone state.done_atis set to current time first, but changes to"0001-01-01T00:00:00Z"on repeated updates.Additional context:
This behavior was observed on the API at https://try.vikunja.io/api/v1/tasks/{id} and /api/v1/tasks/bulk. Clarification on intended implementation of
done_athandling when toggling task completion would be appreciated.Vikunja Version
v1.0.0-rc1-125-a1e95789
Browser and version
No response
Can you reproduce the bug on the Vikunja demo site?
Yes
Screenshots
No response
@kolaente commented on GitHub (Sep 11, 2025):
It should be possible to set this field to a user-supplied value. https://github.com/go-vikunja/vikunja/pull/1461 implements this properly.