Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not detecting new tasks / unable to detect my next_action label #28

Closed
jleseane23 opened this issue Oct 3, 2022 · 15 comments
Closed

Not detecting new tasks / unable to detect my next_action label #28

jleseane23 opened this issue Oct 3, 2022 · 15 comments

Comments

@jleseane23
Copy link

I setup Autodoist in a docker container using the following instructions. It's been working up until now. Before this happened, the container had an uptime of 4 days.

Today, I noticed that any new tasks I input in Todoist weren't receiving my next_action label. I tried to stop the container and edit the command so it'll have a sync time of 45 seconds instead of 5. When I tried to start the container back up, I'm getting errors and it's not acting as if my next_action label isn't there. Here are the following errors.

I'm going to try to run Autodoist directly from my PC to see if I get the same errors

_autodoist_logs.txt

` File "/app/autodoist.py", line 166, in initialise
label_id = verify_label_existance(args, api, args.label, 1)
File "/app/autodoist.py", line 91, in verify_label_existance
response = query_yes_no(
File "/app/autodoist.py", line 65, in query_yes_no
choice = input().lower()
EOFError: EOF when reading a line
Do you want to automatically create this label? [Y/n] �������Q2022-10-03 15:31:05 INFO You are running with the following functionalities:

Next action labelling mode: Enabled
Regenerate sub-tasks mode: Enabled
Shifted end-of-day mode: Disabled

2022-10-03 15:31:05 INFO

Label 'next_action' doesn't exist in your Todoist

Traceback (most recent call last):
File "/app/autodoist.py", line 1005, in
main()
File "/app/autodoist.py", line 959, in main
api, label_id, regen_labels_id = initialise(args)
File "/app/autodoist.py", line 166, in initialise
label_id = verify_label_existance(args, api, args.label, 1)
File "/app/autodoist.py", line 91, in verify_label_existance
response = query_yes_no(
File "/app/autodoist.py", line 65, in query_yes_no
choice = input().lower()
EOFError: EOF when reading a line
Do you want to automatically create this label? [Y/n] �������Q2022-10-03 15:31:07 INFO You are running with the following functionalities:

Next action labelling mode: Enabled
Regenerate sub-tasks mode: Enabled
Shifted end-of-day mode: Disabled

2022-10-03 15:31:07 INFO

Label 'next_action' doesn't exist in your Todoist

Traceback (most recent call last):
File "/app/autodoist.py", line 1005, in
main()
File "/app/autodoist.py", line 959, in main
api, label_id, regen_labels_id = initialise(args)
File "/app/autodoist.py", line 166, in initialise
label_id = verify_label_existance(args, api, args.label, 1)
File "/app/autodoist.py", line 91, in verify_label_existance
response = query_yes_no(
File "/app/autodoist.py", line 65, in query_yes_no
choice = input().lower()
EOFError: EOF when reading a line
Do you want to automatically create this label? [Y/n] �������Q2022-10-03 15:31:10 INFO You are running with the following functionalities:

Next action labelling mode: Enabled
Regenerate sub-tasks mode: Enabled
Shifted end-of-day mode: Disabled

2022-10-03 15:31:10 INFO

Label 'next_action' doesn't exist in your Todoist

Traceback (most recent call last):
File "/app/autodoist.py", line 1005, in
main()
File "/app/autodoist.py", line 959, in main
api, label_id, regen_labels_id = initialise(args)
File "/app/autodoist.py", line 166, in initialise
label_id = verify_label_existance(args, api, args.label, 1)
File "/app/autodoist.py", line 91, in verify_label_existance
response = query_yes_no(
File "/app/autodoist.py", line 65, in query_yes_no
choice = input().lower()
EOFError: EOF when reading a line
Do you want to automatically create this label? [Y/n] �������Q2022-10-03 15:31:15 INFO You are running with the following functionalities:

Next action labelling mode: Enabled
Regenerate sub-tasks mode: Enabled
Shifted end-of-day mode: Disabled

2022-10-03 15:31:15 INFO

Label 'next_action' doesn't exist in your Todoist

Traceback (most recent call last):
File "/app/autodoist.py", line 1005, in
main()
File "/app/autodoist.py", line 959, in main
api, label_id, regen_labels_id = initialise(args)
File "/app/autodoist.py", line 166, in initialise
label_id = verify_label_existance(args, api, args.label, 1)
File "/app/autodoist.py", line 91, in verify_label_existance
response = query_yes_no(
File "/app/autodoist.py", line 65, in query_yes_no
choice = input().lower()
EOFError: EOF when reading a line
Do you want to automatically create this label? [Y/n]
`

@machielkreiken
Copy link

Same issue here. No longer detecting my changes. I recreated the API token hoping it would fix things, but didn't.

It's starting fine, but detects nothing:
CleanShot 2022-12-09 at 13 22 23

@ShayHill
Copy link

Same here. Was working for months previously. Updated to latest python todoist API. No help. Ran locally. No help. This is a bug or API change in Todoist. I would like to investigate, but haven't time ATM.

@ShayHill
Copy link

Losing this automation was a big impediment to my workflow. I have created a similar project with the updated API:
todoist_bot

@Hoffelhas
Copy link
Owner

Hoffelhas commented Dec 13, 2022

Hi there! Thanks all for reaching out and looking into this. Sorry I haven’t been able to reply yet, life is bit hectic at the moment. I'll try to find some time this weekend to take a proper look at this too, since it’s a pretty impactful bug indeed.

@ShayHill
Copy link

ShayHill commented Dec 13, 2022 via email

@Hoffelhas
Copy link
Owner

Hoffelhas commented Dec 17, 2022

Well, fun times! Todoist went from v1.x.x to v2 of their API. The old one is still 'working', but apparently only syncs to an older version all your projects/tasks from a few months ago.

The API has changed quite significantly, so I'm currently working through the entire code to make it compatible again.

@Hoffelhas
Copy link
Owner

Hoffelhas commented Dec 18, 2022

Oof bad news. The new API's of Todoist doesn't allow creating custom properties for tasks any more. This was a functionality that I used to assign my own meta-data, which Autodoist could use to keep track of stuff and work properly.

Even if rewrite all the syntax to the new API, a lot of core functionalities simply don't work any more. I will need to give this some additional thought to see if I can find some kind of workaround or else use an alternative approach to get the same things done. Unfortunately, no quick fix for now.

I'll keep you posted.

@JoergBr
Copy link

JoergBr commented Dec 18, 2022 via email

@Hoffelhas
Copy link
Owner

Hi all, I was able to find a workaround and have just pushed a working version to the dev branch. Currently only labelling is working, I've disabled most of the other features for now so I could focus on the problem at hand.

Before releasing a new master version, there are a few minor things I still want to do:

  • First of all I'll slightly tweak how types are specified on each level (project, section, top-task, sub-tasks), in order to have a better handling on how sections and sub-tasks behave. This is because the code was developed before sections where even a thing, and the amount of subtasks possible where fewer. Should give you guys a bit more flexibility.
  • And of course, see if I can easily reactivate the other functionalities.

In any case, v2.0 planned to be released relatively soon.

@RoccoMathijn
Copy link

@Hoffelhas I have holidays and some time left this week. LMK if you want to pair up or divide some work. Let's get this thing working again.

@Hoffelhas
Copy link
Owner

Hoffelhas commented Jan 10, 2023

@RoccoMathijn Hi there, thanks a lot for your help! First bullet point is now done, it's mostly fixing the other functionalities. I actually do have one I'm stuck with currently and will likely only be able to continue with this weekend.

I've put a new branch up, '26_due_date', where I'm trying to get the 'Postpone the end-of-day' functionality working again. The final thing that needs to happen is that the updated due date needs to be send back to Todoist, which currently is done on line 769 with the REST API. However, this will remove the 'due string' / recurring settings from the task, or basically, updating the due date with the REST API breaks the task. Brilliant.

The alternative would be to use the sync API. An example can be seen if you manually run the 'get_all_data' function (this uses 'get' that's imported from todoist_api_python.http_requests); it actually spits back data. Now this is good, since the Sync API mentions that you can update the due date too. It also mentions that 'Sync API requests should be made in HTTP POST', so perhaps it's possible to use the imported 'post' function. Unfortunately I have not been able to work it out yet.

If you would have some time to poke around this issue a bit, that would be much appreciated!

@RoccoMathijn
Copy link

The sync api has the same behaviour.

But although it's stated in the api docs that: Please note that only one of the due_* fields can be used at the same time (due_lang is a special case). I found out that we can both provide the due_date and due_string.

So with api.update_task(task_id=task.id, due_date=today_str, due_string=task.due.string) it seems to work.

@Hoffelhas
Copy link
Owner

Oh wow, great find. That certainly makes things a lot easier; I'll implement that. Thanks a lot!

@Hoffelhas
Copy link
Owner

Hoffelhas commented Jan 13, 2023

Good news everyone!

I've been able to work through all the important parts. I'll spend some time updating the README, do some final testing, and the goal is to release v2.0.0 this weekend!

Only resetting recurring tasks has not been enabled yet, since nowadays it's a core functionality of Todoist itself. However:

  • it's still more limited than Autodoist
  • it does not restore the original order of the sub-tasks
  • deeper sub-tasks can't be reset

Unfortunately the REST API doesn't show completed tasks, which makes resetting them a bit complicated. I've placed a ticket with the Todoist devs to figure this one out, so for now this feature might be made available again in a future release.

@Hoffelhas
Copy link
Owner

I might have gone a bit overboard with it:

image

But v2.0 is now released!

Thanks to all of you for your support and feedback! It was a great help to make this possible. If any new bugs arise, please feel free to open a new issue tracker. For now, I'll close this one and I'm going to get some sleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants