Editing a task with new "percent_done" removes description #355

Closed
opened 2025-11-01 20:54:51 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @moryoav on GitHub (Feb 11, 2025).

Description

I'm not sure if this is a bug or the intended behavior - I use the API to edit a task. Specifically, I'm changing the percent_done of this task, and when doing that I see that if the task had description, due_date, reminders, other things, everything gets cleared. So is that the intended behavior for the update task API to clear everything that isn't provided? Shouldn't it only change that fields that are provided and keep the previous ones unchanged?
I'm specifically referring to "/api/v1/tasks/{{task_id}}", I'm using it with a payload of percent_done with some [0-1] value.

Vikunja Version

0.24.6

Browser and version

Not relevant

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

Originally created by @moryoav on GitHub (Feb 11, 2025). ### Description I'm not sure if this is a bug or the intended behavior - I use the API to edit a task. Specifically, I'm changing the percent_done of this task, and when doing that I see that if the task had description, due_date, reminders, other things, everything gets cleared. So is that the intended behavior for the update task API to clear everything that isn't provided? Shouldn't it only change that fields that are provided and keep the previous ones unchanged? I'm specifically referring to "/api/v1/tasks/{{task_id}}", I'm using it with a payload of percent_done with some [0-1] value. ### Vikunja Version 0.24.6 ### Browser and version Not relevant ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Feb 11, 2025):

That's intended behaviour. Due to the way go handles null values, we can't detect if you passed a field or have set it to an empty value. That means you'll need to pass all values or Vikunja will reset them when they are not present in the api request.

@kolaente commented on GitHub (Feb 11, 2025): That's intended behaviour. Due to the way go handles null values, we can't detect if you passed a field or have set it to an empty value. That means you'll need to pass all values or Vikunja will reset them when they are not present in the api request.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#355