Closed FlashSystems closed 4 years ago
$:/config/Drafts/TypingTimeout
is only used for the TW page refresh. ... Saving back to the server is as fast as possible. There is no timeout atm.
I did have a look at the syncer.js code. IMO changing this behaviour can be tricky. TW internally can change several tiddlers at the same time. All of them are marked "dirty". They are written to a syncer task queue.
There are 2 possible actions. "save" and "delete". ... The "save" action has priority. eg: Only if "save tiddler" is OK a "delete draft tiddler" is allowed. Otherwise it is possible, to delete the draft, but save may have an error and we loose data.
If we want to delay 1 action, we basically have to delay them all, to avoid "race conditions". eg: Within 10 seconds it's possible "edit / save" a tiddler 20 times.
Thank you for the pointer to syncer.js
. Within the code I found the $:/config/SyncThrottleInterval
configuration tiddler that does exactly what I wanted.
Now there is only one question left: This values is completely undocumented. Is there a reason for this? Is it safe to mess with it and change it from its default of 1 second to 5 or 10 seconds?
Hi @FlashSystems the $:/config/SyncThrottleInterval
setting is currently undocumented, but it does indeed control the interval before a modified tiddler will be saved back to the server. Let us know how you get on with different settings for it.
I tested my two TiddlyWiki installations with a SyncThrottleInterval
of 5000 and 10000. Both intervals work perfectly. No issues so far. The synchronization status icon is correctly showing the current sync status. This allows me to make sure everything is synced before closing the browser window.
I think this feature works reliably enough to be mentioned in the docs. 👍
Thank you for your support.
Thanks @FlashSystems
I'm a fairly fast typist and when writing a longer tiddler there are continuous
PUT
requests (every second) to the Node.js back-end. I had to reconfigure the flooding protection of my reverse proxy to get TiddlyWiki working.Is there a way to throttle the TiddlyWeb-Saver? I tried to set
$:/config/Drafts/TypingTimeout
but this did not change the pace of the put requests. Saving every 10 Seconds or so should strike a good balance between the number of requests and loosing work if the browser tab/window gets closed.Log
A short log that shows the PUT-Requests almost every second.
Versions
TiddlyWiki 5.1.22 on Node.JS 14.13.