Tiddlywiki file suddently corrupted on save (commas missing in TW inner JSON file)

74 views
Skip to first unread message

Eric N

unread,
Oct 29, 2021, 11:19:43 AM10/29/21
to TiddlyWiki
Hi all,

Today I opened my TW file to work on it, and it was blank. Last time I used it it was perfect.

I tried to import that broken file into a fresh empty TW: error message saying that the JSON file was broken, "missing , or ]".

So I checked the file and I had approx 100 instances of "}{" instead of "},{". Weird.

Fixed them all, then I could open the file again and retrieved my work. BUT… I added a new simple tiddler, and saved, and the file got broken again. Was back with my 100 "}{".

Tried to import the fixed file into a fresh empty TW, and add a simple tiddler then saved: got a broken TW file with 100 "}{".

Does anyone knows what is happening ?

Versions:
- MacOS 11.6
- Firefox 93.0
- TW 5.2.0

Best,
Eric


Jeremy Ruston

unread,
Oct 29, 2021, 1:29:59 PM10/29/21
to TiddlyWiki
Hi Eric,

Thanks for the detailed report. There is some conditional logic in the JSON tiddler output template to handle including a comma before every tiddler except the first. It seems that that logic has got corrupted, but it's not immediately obvious how.

Are you using any TW plugins? Does the wiki include any JavaScript modules (ie tiddlers with type "application/javascript")?

Best wishes

Jeremy

Eric N

unread,
Oct 30, 2021, 2:53:17 AM10/30/21
to TiddlyWiki
Hi Jeremy,

thanks for your answer it was very helpful !!

From your email I understood that my problem could come from a plugin or a javascript module.

I first tried to uninstall all the modules but that didn't help. So I imported all my data (i.e. the tiddlers that I am the creator of) into a fresh empty TW, and I imported the plugins one by one. Doing so, I found the one that broke my TW. Following the instructions on http://tidtoc.tiddlyspot.com/#GettingStarted:
- then drag to my TW the toc snippet from http://tidtoc.tiddlyspot.com/#GettingStarted

I've double checked, tried to import other modules, and my TW is working well, as long as I don't import the two elements above.

From my side, the problem is thus solved.

But if this needs to be investigated further, I"ll be happy to help.

Best,
Eric

strikke...@gmail.com

unread,
Oct 30, 2021, 5:27:28 AM10/30/21
to TiddlyWiki
http://eucaly-tw5.tiddlyspot.com/ list matchfilter as Old Plugins (not recommanded). In a tab below is some explanation of changes in support of regexp.

PMario

unread,
Oct 30, 2021, 9:25:15 AM10/30/21
to TiddlyWiki
It's probably the "match" filter operator that causes the problems. TW implemented it's own "match" with V5.1.20 and the old plugin probably overwrites it.
IMO you are lucky, that it didn't "brick" the whole system. ...

The "match" operator is used by the $:/core/templates/store.area.template.html which is responsible to save the tiddler store. ... Just a guess, but there may be the problem. ..

-mario

Eric N

unread,
Oct 30, 2021, 9:33:02 AM10/30/21
to TiddlyWiki
Thanks Mario, I understand better why it wasn't working.
And indeed, I am very happy I could save my data !!

Eric N

unread,
Oct 30, 2021, 10:30:29 AM10/30/21
to TiddlyWiki
FYI, in order to fix my issue, i.e. to overcome the TW's "match" vs Eucaly's "match" name conflit mentioned by Mario, here is what it did.
Might be useful to anyone willing a have a table of content per tiddler

1/ create a new tiddler called $:/core/modules/filters/matcheucaly.js
2/ set type as application/javascript, and field module-type as filteroperator
3/ copy paste everything from http://eucaly-tw5.tiddlyspot.com/#MatchFilter 's $:/core/modules/filters/match.js tiddler into the above tiddler
4/ replace exports.match = ... by exports.matcheucaly = ...
6/ replace match by matcheucaly in the imported toc tiddler
7/ save, restart
8/ and tada! The TOC per tiddler by Tobias Beer is working again :)

Thanks for all the help,
Eric
Reply all
Reply to author
Forward
0 new messages