Synced TODO

💡 Sync Demo:
The server has exposed a PostgreSQL database to this client via EdgeWorker. This client has a local FlashQL instance that syncs with the remote DB. It has also now queried the local FlashQL instance.
This is a live query, so you should see updates appear here in real-time as remote DB changes or local updates propagate.

To trigger remote writes directly, try running the included update.js script. Updates should sync from the upstream DB to the local DB.
To trigger local writes, use the buttons above. Try adding new items or marking existing ones done. Updates should sync from the local DB to the upstream DB.

💡 Multi-Tab Sync:
Open a second tab to see changes sync across clients in real-time!
Make changes in one tab or directly on the remote database (via update.js). Updates should sync across all tabs!

💡 Offline Test:
Open Chrome DevTools -> Network tab -> Change "No throttling" to "Offline".
Try adding or editing items while offline, then switch back to "No throttling" (Online) and watch the local DB automatically sync with the upstream PostgreSQL!
Try switching the write_policy from origin_first to local_first in the index.html source code to opt into optimistic UI behavior when offline!