fix: Update to latest Todoist API
Todoist announced their intent to move to a new API on April 5, 2025 [1]. They shutdown the old APIs on February 10, 2026 [2].
The migration was a little more onerous than I expected. The new API documentation shows a `/tasks/completed/by_completion
_date route` that indicated it would be perfect. Unfortunately, recurring tasks (the ones I care about) don't appear in that API endpoint's response (presumably because the task is still/again open for completion).
After trying a few other approaches, I found the activity API which I can filter down to recent completion events, giving me the same result.
LIMITATIONS:
As part of the new API, Todoist also changed all the object ids. [3] They've apparently been returning a `v2_*_id` since 2023 (so the entire lifetime of this app) that I could have been using here. But, I didn't so now I get to write a migration that has to link between IDs I can't directly reconcile...
I think I'll do a name match. For a lot of syncing systems, that's a bad idea, but for habits, I doubt people have actually been relying on the unique ids of identically named, but differently recurring tasks to track _different_ habits. In my case, I have several tasks that have multiple intances in Todoist to get the recurrence schedule I want, but it's a bit annoying to link them separately in this Habit Sync app. So, I think a name match is appropriate.
We'll still keep the IDs though -- that way we can detect if a task is renamed.
[1] https://groups.google.com/a/doist.com/g/todoist-api/c/LKz0K5TRQ9Q
[2] https://groups.google.com/a/doist.com/g/todoist-api/c/brwENjfT_tk
[3] https://developer.todoist.com/api/v1/#tag/Migrating-from-v9/General-changes/IDs