sachaos / todoist

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

Speed up interactions by adding incremental sync option #261

Open definitely4lt opened 3 weeks ago

definitely4lt commented 3 weeks ago

For me, it can be quite slow to add/close tasks. I think is happening because we are always running a full sync command after most of these operations.

I was wondering whether someone might have ideas on how to make use of the incremental sync that the Todoist API offers. See here.

After each sync command, we should get back a sync_token. If we use this value when calling the next sync, instead of always passing * as is done now (see here), we should be able to speed up adding/closing tasks tremendously.

I think the easiest way would be to store the sync_token somewhere globally, and re-use it when calling the sync option. Perhaps we can let users decide whether to turn on this incremental sync behavior by setting a feature flag somewhere, defaulting to doing a full sync every time (as is the current behavior).

Looking forward to hearing your thoughts! I'm happy to help to the contribution of this feature, although go is quite new for me.