sachaos / todoist

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

Bust the sync cache when the token changes #212

Closed dwainm closed 1 year ago

dwainm commented 1 year ago

If you change your token (for the case of changing accounts or adding multiple accounts, see #211), we still return data from the previous account.

The synced cache should compare the config token against that token stored in the sync storage. If no new one exists, we should still use the old sync, but if a new/different one is present, we should bust the cache and potentially call sync again.

dwainm commented 1 year ago

Thanks for the fix, @kenliu!

kenliu commented 1 year ago

thanks goes to @HacDan for the patch