Using browser-storage for online/offline sync

Hi all. I am using the browser-storage plugin in conjunction with the tiddlyweb plugin. The browser storage plugin provides the basis for saving locally when the server is not available, but if the browser is closed or you navigate away, the tiddlers saved in browser storage are not lost, but they do not sync to the server when connectivity is restored.

I created a browser-storage-sync plugin that handles re-syncing the tiddlers from browser storage to the server and removing a tiddler from browser storage whenever sync is complete. It is also conditional on the presence of the browser-storage plugin and is otherwise inert.

Please note it works in conjunction with the tiddlyweb plugin and the browser-storage plugin. You need to modify the browser-storage plugin’s save filter to save all tiddlers, or the set you want this feature to support (by default, browser-storage plugin’s save filter only saves state tiddlers).

I made it for my own use, but hope others will find it useful as well.

6 Likes

A clever solution!
Very interesting!

@fkmiec thanks very much for addressing this, something I have being looking at for a while. Effectively detachable wikis.

Tiddlytalk says this is the fist time you have posted, so welcome, and I am sure you would understand that a few people from @pmario to @saqimtiaz and @jeremyruston to name a few could take a closer look for two reasons.

  • First validate the code you have shared from a security perspective, after all this is your first post, and that is a large Javascript module.
  • To consider your solution as something that may become part of the core