sachaos / todoist

Todoist CLI Client. I ❤️ Todoist and CLI.
MIT License
1.48k stars 104 forks source link

sync produces Error: json: cannot unmarshal bool into Go struct field .reminders.is_deleted of type int #214

Closed erstaples closed 1 year ago

erstaples commented 1 year ago

Just installed the todoist CLI. Unable to sync:

eric:~/ $ todoist sync
Error: json: cannot unmarshal bool into Go struct field .reminders.is_deleted of type int
FlohGro-dev commented 1 year ago

same error for me, I deleted the token in my config file but still didn't work. also did a brew upgrade todoist before

kenliu commented 1 year ago

I tried to repro this by reinstalling 0.18.0 and deleting the config file and unable to reproduce on my Mac. Also tried reproducing this from latest master build on my linux machine.

nv1t commented 1 year ago

I think the problem arises in https://github.com/sachaos/todoist/blob/master/lib/sync.go#L53

If a task exists with a reminder, this struct is getting used and probably fails. By changing this integer to boolean, the error message is gone for me.

It seems weird, that every isDeleted is a boolean except for this line.

This has nothing to do with the config. It is the response coming from the server.

kenliu commented 1 year ago

@nv1t Thanks for troubleshooting! if you want to open a PR for this I can merge

kenliu commented 1 year ago

@sachaos can you do a 0.18.1 release for this change?

erstaples commented 1 year ago

Awesome, thanks for the fix!!!