[WIP] Google Tasks Sync: Bidirectional synchronization with TiddlyWiki

Hello everyone,

I am currently developing a plugin to enable bidirectional task synchronization between TiddlyWiki and Google Tasks.

Demo: https://google-tasks.tiddlyhost.com/

The long-term goal is to integrate this workflow with Projectify.

Security Disclaimer

Pre-Alpha / Proof of Concept: This code is currently functional but experimental. It was developed with LLM assistance and uses localStorage for storing tokens. Please do not use this with sensitive Google accounts yet. If you want to test this, please use a throwaway google account.

Roadmap

The immediate to-do list includes:

  • Migrating from Client-Side Auth to a Google Apps Script backend to keep tokens off the browser. They are only valid for one hour but I’m not comfortable with having tokens stored in the local storage.
  • Move fetched data to $:/temp/ tiddlers to prevent data leakage in saved files.
  • Adding an explicit “Logout” button and cleaning up the CSS.

Feedback welcome!

1 Like

That’s a very interesting project. Well done! Thx for sharing.

I did a very fast skim of the code files, that are opened at your linked wiki.

  • The overall concept is nice
  • Using an action-widget, which does not create HTML output, but uses the default TW UI mechanisms should be safe
  • The Google API is “hardened” by Google, so it should be OK. Since there should be enough code out there that uses this API. It should be safe. (As I wrote I only skimmed the code.)

You can use the following prompt. After making a backup of the existing code eg:

You are a TiddlyWiki, Google Task API and web security expert for javascript code
Please check those files ... (file list) as a web security expert
No code should be changed.
Only give advice.
Also output your explanation into an audit.md file

After the audit.md file is created, you can copy and modify that one as a new prompt, for the changes you want to apply to the code – Or none, if it says it’s OK.


To clean up the TW UI, you can tell it, that it should move the STYLE elements used in $:/plugins/google-tasks/ui/editor into its own tiddler. eg: $:/plugins/google-task/ui/editor/styles tiddler, which is tagged: $:/tags/Stylesheet

This can be done after you are happy with your styles or if the UI code gets much lager. Handling 2 files is a bit more cumbersome than 1 file. But if the 1 file is much lager it usually needs more tokens to modify it. So you need to find a balance which feels OK for you.

Just some thoughts.

Have fun!
Mario

1 Like

Perhaps this is coincidental but I got a message recently that Google Keep Reminders now become google tasks, and separately know Google Tasks can be viewed in Google Calendar. If TW and Projectify can be integrated with Google Tasks it may be a nice way to to take a locally hosted organisational wiki and push to do items to ones mobile device when away from your wiki.

  • Even better if done items can be flagged back in tiddlywiki (although not necessarily)

Thanks for the feedback Mario! I’ve used your prompt to get a list of security fixes I need to prioritize. It’s still a WIP of course so if I missed anything please let me know.

Good catch. I noticed the API puts them in a list called “Old Google Keep Reminders”. More info here: Google Keep reminders migration to Tasks more widely rolling out

Note that the Tasks API doesn’t provide start/end times yet, so if you use this tool to move a task from one list to another, the time data will be lost (I can only get / update the due date).

Since users have been asking Google for this feature for over 5 years, I am not waiting on them. I plan to save the start/end times as front matter metadata in the “Notes” field of the task. This will allow TiddlyWiki to handle the scheduling fully until the API eventually catches up.