Doist / todoist-python

DEPRECATED The official Todoist Python API library
MIT License
535 stars 73 forks source link

Can't delete project with temp id #81

Open hasii2011 opened 4 years ago

hasii2011 commented 4 years ago

I list the projects I have in my account

Inbox        - projectId=2149220438
Personal     - projectId=2149220439
Volunteer    - projectId=2209278874
Development  - projectId=2234544315
Big Mo       - projectId=2234544340
Little Mo    - projectId=2237279811
Condo        - projectId=2237946044
Mini Mo      - projectId=2238846449
PyUt         - projectId='$bd5ab41c-ed5b-11ea-bd10-f40f242dd539'

The I do this using the projectID for PyUt

            todoist.projects.delete(projectId)
            todoist.sync()
            todoist.commit()

I get:

_todoist.api.SyncError: ('2f54a07a-efb2-11ea-a426-f40f242dd539', {'error_tag': 'INVALID_TEMPID', 'error_code': 16, 'error': 'Invalid temporary id', 'http_code': 400, 'error_extra': {}})_

The PyUt Project is not visible in the Todoist App.

How to get rid of it?

heimgreg commented 3 years ago

I don't know if this is still relevant after a few months but I just had the same issue.

The project with temp id does not exist on the Todoist Servers but only locally on your machine. For me, deleting the cache (~/.todoist-sync/) solved the problem. I guess, calling todoist.reset_state() would also help.

hasii2011 commented 3 years ago

Ok, so I whacked it that way also