alanvardy / tod

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

BUG: Quick-add task creation error #798

Closed stacksjb closed 5 months ago

stacksjb commented 5 months ago

On the latest version, it appears that task quick-add creation is broken.

I can successfully view tasks and create them using regular "Task create", but "task quick-add" fails.

➜  ~ tod -v task quick-add -c test
⠄ Querying API=== DEBUG ===
POST https://api.todoist.com/sync/v9/quick/add
body: {"auto_reminder":true,"text":"test"}
===

Error from reqwest:

            method: POST
            url: /sync/v9/quick/add
            body: {"auto_reminder":true,"text":"test"}
            Error: Response { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.todoist.com")), port: None, path: "/sync/v9/quick/add", query: None, fragment: None }, status: 403, headers: {"content-type": "application/json", "content-length": "214", "connection": "keep-alive", "date": "Thu, 13 Jun 2024 19:29:44 GMT", "cache-control": "no-cache", "referrer-policy": "strict-origin-when-cross-origin", "retry-after": "4", "server": "gunicorn", "set-cookie": "tduser=v4.public.eyJ1c2VyX2lkIjogMjIxMTUwNSwgImV4cCI6ICIyMDI0LTA2LTI3VDE5OjI5OjQ0KzAwOjAwIn1ZYggJ9L-pwXzfU2Rd_ciZWSClKL_zdDzfXgouITQLlluLhldkwM1P5GsyVDXrTgFcztUX2kqyL-UoXO5wvXwD; Domain=.todoist.com; Expires=Thu, 27-Jun-2024 19:29:44 GMT; Max-Age=1209600; Secure; HttpOnly; Path=/", "set-cookie": "todoistd=\"/CUdA09psYiwY7pwgn9sRGC/RQQ=?\"; Domain=.todoist.com; Expires=Fri, 13-Jun-2025 19:29:44 GMT; Max-Age=31536000; Secure; HttpOnly; Path=/; SameSite=None", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "vary": "Accept-Encoding", "x-cache": "Error from cloudfront", "via": "1.1 07439389705f227599a889b20b6078de.cloudfront.net (CloudFront)", "x-amz-cf-pop": "SLC52-P1", "x-amz-cf-id": "ynahPhZhUtHutfUGsi_Gi_FgCWeWZ9_MylTYTF3Hk7CWLs4K1Wrurw=="} }
➜  ~
stacksjb commented 5 months ago

Ok, this one is on me. It appears something broke with my GCal integration and it imported a hundred items into Todoist and filled up the inbox, so new task creation failing. However, the error message isnt' clear, I'll open another bug for that.

stacksjb commented 5 months ago

Manually attempting an API call with CURL gives me a proper error under the "Error_tag" field that is returned. This does not appear to be currently parsed, opened #799

➜  ~ curl https://api.todoist.com/sync/v9/quick/add \
>     -H "Authorization: Bearer xxxxx" \
>     -d text='Buy Milk @Drinks #ShoppingList +Bob'
{"error":"Maximum number of items per user project limit reached","error_code":49,"error_extra":{"event_id":"979ed76032f54af58c859bc0193e6d9f","retry_after":5},"error_tag":"MAX_ITEMS_LIMIT_REACHED","http_code":403}%
alanvardy commented 5 months ago

Thanks for the issue and the investigation :+1: