Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding tiddler programmatically without text field causes serious recursion error in nodejs mode #2025
there seems to be a serious problem with the nodejs syncer when programmatically adding tiddlers and opening them. Can you confirm the recursion bug resulting from the setup below?
edit: as @tobibeer pointed out, this error is caused when the text field is not set when adding a tiddler to the store and then opening it
The following is tested in chrome, haven't tested other browsers yet.
1) Create a wiki with the following
I would imagine the browser thinks he only got a skinny version of this tiddler loaded and so it's asking the server "hey, server, give me the text now, too" via
To verify if this might indeed be what happens, try adding a text field to your test tiddler and see if it stops going crazy.
Perhaps adding a tiddler to the store in the browser console requires some pushing to the server?
added a commit
Oct 14, 2015
We should probably add some info about mandatory fields to: http://tiddlywiki.com/#TiddlerFields
There are 2 little helper functions:
We may introduce a new little helper eg:
What do you think?
I agree with @tobibeer here. TW never required the text field of a tiddler to be set so it makes more sense to fix this in the syncer than to start telling people now they should add some fixer method, this would be a bit strange and non-consistent (what about people that don't do it?).
That would be an option. But preferably this bug should be fixed at the place where it actually occurs: in the syncer mechanism. I mean this only affects nodejs users and is strictly speaking not a TW core problem.
What needs to happen here is that the browser module caches...
...and then not ask the server for the full text again untill some polling mechanism or the likes tells the browser that there is new stuff on the server and so the browser module removes those titles from the cache so as to allow to reload them as needed.
Possibly any polling would require refreshes anyway, independent of any "tiddlers-without-text-cache".