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

request for completed items returns Error: json: cannot unmarshal number into Go struct field CompletedItem.items.user_id of type string #231

Closed
dasice opened this issue Apr 28, 2023 · 8 comments
Labels

Comments

@dasice
Copy link

dasice commented Apr 28, 2023

I'm assuming this is a deprecated API? Is there some way I can dump the contents of the JSON to help debug?

@kenliu
Copy link
Collaborator

kenliu commented Apr 29, 2023

Confirmed that this is a bug, running latest master.

@kenliu kenliu added the bug label Apr 29, 2023
@kenliu
Copy link
Collaborator

kenliu commented Apr 29, 2023

This looks to be a bug in the response coming from the Todoist API.

The "user_id" field is returning as an integer instead of a string as in their API documentation. https://developer.todoist.com/sync/v9/#get-all-completed-items

I think for now the best course of action is to wait a few days for Todoist to resolve it on their end. I've opened a support ticket with Todoist to report this bug.

@kenliu
Copy link
Collaborator

kenliu commented Apr 29, 2023

BTW you can pass a --debug flag to todoist but unfortunately it does not log the response body so it doesn't help with troubleshooting an error in the JSON.

@dasice
Copy link
Author

dasice commented May 1, 2023

yeah it would be nice for the debug to dump the json in the case that there's an error, but it's not a big deal

@kenliu
Copy link
Collaborator

kenliu commented May 2, 2023

Got a response from todoist support. They said they are going to look into this and determine if the API change was intentional or not.

@kenliu
Copy link
Collaborator

kenliu commented May 2, 2023

@dasice I created #233 to add logging for the API response.

@kenliu
Copy link
Collaborator

kenliu commented May 5, 2023

@dasice todoist support says this is now resolved, it was a bug in their API that caused this.

UPDATE: We found the bug and made the correction now. The documentation was correct and so you should now be getting strings (and not integers) going forward.

@dasice
Copy link
Author

dasice commented May 8, 2023

Thank you, I can confirm that it works for me now, I really appreciate your upstream representation.

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

No branches or pull requests

2 participants