alanvardy / tod

An unofficial Todoist command line client written in Rust
MIT License
96 stars 9 forks source link

Completed tasks are still processed #615

Open rvbcldud opened 7 months ago

rvbcldud commented 7 months ago

After I complete a task while processing a project, it shows up again to be processed:

image

I double checked to see that the task was successfully completed.

Is this the expected functionality? If not, let's look into this!

Maybe it is not checking the is_completed field?

rvbcldud commented 7 months ago

One additional detail: this task is a sub task. That may have something to do with it. In that case it seems similar to #611

alanvardy commented 7 months ago

Thank you for the issue @rvbcldud , I'm currently resolving this by using tod filter process and having my filter include !subtask. I need to filter out subtasks on actions under the project subcommand I think, need to test it a little more.

stacksjb commented 6 months ago

I tested this with subtasks and can confirm this is still a bug. Should be able to complete subtasks.

stacksjb commented 6 months ago

It looks like api calls to project tasks return/include subtasks even when completed, unless the parent task is completed.

I am reaching out to Todoist API support to investigate/test if this is intended as design.

If it is, I would recommend adding logic to filter out "is_completed" : true tasks to address this specific use case. I think this is logic that would have to be added after received, not as part of the query.

@alanvardy can you confirm the APIs being called for this particular function are these ones? ~~GET https://api.todoist.com/rest/v2/tasks?project_id= And for deleting task: POST "https://api.todoist.com/rest/v2/tasks//close~~

Discovered I can use -v (verbose) for debugging, we're good here.

stacksjb commented 6 months ago

In test API calls, it looks like for tasks with subtasks, it looks like the number of uncompleted tasks + at least 1 subtasks (even if all are completed) is returned.

Checking off the parent task works correctly, however if a parent task is uncompleted, even if all the child tasks are completed, it will always return at least one child task (either with a "is_completed: true" status, or whatever the correct status is).

I believe the intention is that you can track tasks that are parent/subtasks based on parent_id (and filter based on that and is_completed), but I will look into this further.

stacksjb commented 6 months ago

Initial discussion with Todoist team is that this is likely an API bug, but still testing.. will update

stacksjb commented 5 months ago

Have reproduced the error and submitted to Todoist API team. API is inconsistent with official client.

When tasks are closed via the API, they are still returned in project queries (although with a status of is_closed: yes) When closed via the App, they are no longer returned.

rvbcldud commented 5 months ago

Great job @stacksjb ! Thanks for looking into this

stacksjb commented 3 months ago

Todoist confirmed this is a bug and they will fix it at some point, but it hasn't yet been prioritized by their devs.

stacksjb commented 3 months ago

Marking as known bug on Todoist's side; will review/followup with them periodically