TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.05k stars 1.19k forks source link

[BUG] Confusion around whether/which system tiddlers to live sync between client and server #4882

Open hoelzro opened 4 years ago

hoelzro commented 4 years ago

Describe the bug Whether or not to sync system tiddlers is unclear, or at least which system tiddlers would be wise to live sync.

This is a continuation of #4868, which is more focused on the $:/StoryList tiddler

hoelzro commented 4 years ago

Part of my confusion lies in the fact that TiddlyWiki's UI is built upon various system tiddlers, so syncing these among clients results in the UI changing state. For example, clicking on a sidebar tab will (eventually) make that tab the displayed one on all clients.

I'd also like to clarify that I'm thinking specifically about "live sync" - what I mean by that is tiddlers that change on the server after I've loaded the wiki into a client (eg. a browser tab) getting picked up by that client when it's checking in with the server.

@pmario points out in the original issue that TiddlyWeb's recipes and bags feature could be leveraged to solve this - you'd just need to make sure each client has their own recipe, and the outermost bag in each client's recipe would be where system tiddlers would be written, if I understand correctly.

pmario commented 4 years ago

A recipe can contain several bags. You can have 1 bag, that is responsible for system tiddlers. Users need to make sure, that recipes only contain their own system_bag.

The client needs to know, from which bag a tiddler comes from. .. This can be achieved in 2 ways. TW can store the "bag info" with the tiddler or it can create a "hash-table" tiddler, that keeps track, where the tiddlers come from. The later is used at the moment.