Weird behavior of File Backups with TWc

138 views
Skip to first unread message

Ton Gerner

unread,
Aug 6, 2019, 2:38:45 PM8/6/19
to TiddlyWikiDev
Hi all (and especially Mario),

System in use:
Linux Mint 19.2
Firefox 68.01 & Firefox dev 69.0b10
TWc 2.8.1

I am a very satisfied user of Mario's File Backups; I use it for a lot of TW5 wikis. I use it for a few TWc wikis as well and there started a problem a few days ago. I saved a (big and heavily modified) TWc wiki. After refreshing the browser tab I got the following error message:

File-backups.png


After clicking OK the TWc wiki did not load anymore. Comparing the wikis before and after saving showed differences at 15 places (only the first and last change important); see the P.S.

Thereafter I did some tests with a Minimal Test Case (empty TWc 2.8.1; closing/restarting FF in between tests)

Test 1: standard FF (all add-ons enabled) => error message after saving/refreshing but wiki reloads normally
Test 2: standard FF (all add-ons disabled except File Backups) => error message after saving/refreshing but wiki reloads normally
Test 3: standard FF (reinstalled FB, other add-ons disabled) => error message after saving/refreshing but wiki reloads normally
Test 4: FF dev (all add-ons disabled except File Backups) => error message after saving/refreshing but wiki reloads normally
Test 5: empty 2.9.2 standard FF (all add-ons disabled except File Backups) => error message after saving/refreshing but wiki reloads normally

Comparing the TWc wikis before and after saving showes differences at 3 places:

empty 281 before save:

<!--PRE-HEAD-END-->
<title>

</title>

...

<div id="storeArea"></div>

...

<!--POST-SCRIPT-END-->
</body>
</html>


empty281 after save:

<!--PRE-HEAD-END-->
<title> My TiddlyWiki - a reusable non-linear personal web notebook </title>

...

<div id="storeArea">

</div>

...


!--POST-SCRIPT-END-->


<div id="tiddlyfox-message-box" style="display: none;" data-message-box-creator="file-backups"></div></body></html>


The same differences can be seen with TWc 2.9.2.

What strikes me most is the fact that it does not happen with Windows 10 and FF 68.01! Even the heavily modified TWc saves/reloads without message/problems!

File Backups works perfectly with TW5!

Questions:

1) Is it possible that FF 68.01 behaves different under Windows 10 then under Linux Mint?
2) Can someboy confirm my findings with Linux Mint (Ubuntu/Debian) & FF?

Thanks in advance,

Ton

P.S. In the heavily modified TWc 15 changes were found after saving:

1) Some code had been deleted after the head section:


<body onload="main();" onunload="if(window.unload) unload();">

2) ..14) Unimportantant changes (order of items; mainly plugin headings)
15) The added div at the end:


<div id="tiddlyfox-message-box" style="display: none;" data-message-box-creator="file-backups"></div>

Removing the div and adding the deleted code (in a text editor) created a working TWc again.






PMario

unread,
Aug 7, 2019, 2:34:19 AM8/7/19
to TiddlyWikiDev
 Hi Ton,

I'll have a closer look.

-m

PMario

unread,
Aug 7, 2019, 2:37:56 AM8/7/19
to TiddlyWikiDev
On Tuesday, August 6, 2019 at 8:38:45 PM UTC+2, Ton Gerner wrote:
 
15) The added div at the end:


<div id="tiddlyfox-message-box" style="display: none;" data-message-box-creator="file-backups"></div>

Removing the div and adding the deleted code (in a text editor) created a working TWc again.

As you found out, we added a marker at the end of the TW internal DOM, to identify the browser addOn that first added it. ... This DOM element shouldn't be saved. ... So removing it with a text editor should do no harm and really fix the problem as a workaround.

-m

Ton Gerner

unread,
Aug 7, 2019, 2:58:41 AM8/7/19
to TiddlyWikiDev
Hi Mario,

Thanks

Ton

Ton Gerner

unread,
Aug 7, 2019, 3:00:33 AM8/7/19
to TiddlyWikiDev
Hi Mario,
Yeah,
As I wrote: Removing the div and adding the deleted code (in a text editor) created a working TWc again.

Cheers,

Ton

 

BJ

unread,
Aug 8, 2019, 5:24:22 AM8/8/19
to tiddly...@googlegroups.com
in firefox they fixed a serurity issue, (which now prohibits downloading local files)


I modified savetiddlers get around this but, now only the latest tiddlyclassics will work (those that have the html5 download modifications)

all the best

BJ


On Wednesday, August 7, 2019 at 8:34:19 AM UTC+2, PMario wrote:

@TiddlyTweeter

unread,
Aug 8, 2019, 6:32:37 AM8/8/19
to TiddlyWikiDev
Does it interfere with TWC default saving to the "downloads" folder?

I'm interested in TWC saving.

Josiah

PMario

unread,
Aug 27, 2019, 3:38:54 PM8/27/19
to TiddlyWikiDev
Hi Ton,

I think I did find the real problem and fixed it. ... There is a new beta version. Please try it: https://github.com/pmario/file-backups/issues/28#issuecomment-525451252

have fun!
mario

PMario

unread,
Aug 27, 2019, 3:43:48 PM8/27/19
to TiddlyWikiDev
Hi BJ,

There seems to be a problem in TWc, which is there for a long time already. .. As you pointed out, it causes a problem now. ... I'll open a new issue at: https://github.com/TiddlyWiki/TiddlyWiki/issues once I'm sure I did fully understand what's going on.

It would be nice, if you could join in. ... Can you point me to the fixes, you had to make to your plugin?
-mario

Ton Gerner

unread,
Aug 28, 2019, 4:04:08 AM8/28/19
to TiddlyWikiDev
Hi Mario,

I think I did find the real problem and fixed it. ... There is a new beta version. Please try it: https://github.com/pmario/file-backups/issues/28#issuecomment-525451252

Bingo! Version 0.3.10 works for me.
Since it was quiet in the groups about saving TWc with File Backups I thought: 'Am I the only one? Something wrong with my system?'
But I see now that at Github the same behavior was reported (and also that it was still working under Windows 10).
 
The following tests (added new tiddler, saved and reloaded) were all succesful for:

Linux Mint 19.2
Firefox 68.02

  • various TW5s
  • empty 2.8.1
  • empty 2.9.2
  • heavily modified TWc 2.8.1
  • heavily modified TWc upgraded to 2.9.2
Thanks a lot.

Ton

PMario

unread,
Aug 28, 2019, 7:01:07 AM8/28/19
to TiddlyWikiDev
On Wednesday, August 28, 2019 at 10:04:08 AM UTC+2, Ton Gerner wrote:
Hi Mario,

I think I did find the real problem and fixed it. ... There is a new beta version. Please try it: https://github.com/pmario/file-backups/issues/28#issuecomment-525451252

Bingo! Version 0.3.10 works for me.

That's great.

Since it was quiet in the groups about saving TWc with File Backups I thought: 'Am I the only one? Something wrong with my system?'
But I see now that at Github the same behavior was reported (and also that it was still working under Windows 10).

Yea, the problem is a little bit strange and has to do with the differences in the file system "path" handling.
 
 The following tests (added new tiddler, saved and reloaded) were all succesful for:

Linux Mint 19.2
Firefox 68.02

  • various TW5s
  • empty 2.8.1
  • empty 2.9.2
  • heavily modified TWc 2.8.1
  • heavily modified TWc upgraded to 2.9.2
Thanks a lot.

You are welcome.

For the records:

I did my testes with Windows 10, ubuntu 18.04. ... TW 2.6.5 and TW 2.9.2

have fun!
mario

Yakov

unread,
Aug 28, 2019, 4:29:42 PM8/28/19
to TiddlyWikiDev
Hi Ton,

you may also be interested in Timimi for TWC, it's quite handy with FF, although the Timimi's advanced backups system is not supported yet for TWC.

As for your initial problem, try to disable security.fileuri.strict_origin_policy option in your FF's about:config. I suspect that the culprit is recreateOriginal which doesn't take into account some aspects of saver plugins; current Timimi implementation has a similar issue, which I haven't reproduced yet but I'll check my guess too.

Best regards,
Yakov.

вторник, 6 августа 2019 г., 21:38:45 UTC+3 пользователь Ton Gerner написал:

PMario

unread,
Aug 29, 2019, 3:47:06 AM8/29/19
to TiddlyWikiDev
On Wednesday, August 28, 2019 at 10:29:42 PM UTC+2, Yakov wrote:
...
As for your initial problem, try to disable security.fileuri.strict_origin_policy option in your FF's about:config.

Not everyone is comfortable disabling "security" related settings, since there is a reason for them, as BJ pointed out: https://www.mozilla.org/en-US/security/advisories/mfsa2019-21/#CVE-2019-11730
 
I suspect that the culprit is recreateOriginal which doesn't take into account some aspects of saver plugins;

With the fix, that I implemented this workaround is not called anymore, since the intended function is called and succeeds.

And yes. It seems recreateOriginal causes a backwards compatibility problem, with every TiddlyFox compatible saver addOn. ... The original TiddlyFox addOn did create a DOM element named: tiddlyfox-message-box

At the init-phase of the AddOn startup, we check for the existence of this element and add a marker. So other AddOns, that know about it, can print a message, that only 1 saver addOn can be active at the same time. If an other SW is detected, the add-on disables itself. ... see my addOn code. BJ has a similar function.

This DOM element should not be saved to the file. ... It seems if "recreateOriginal" is called, it is saved and breaks the file, so it can only be fixed with a text editor, removing the element.

The problem I had to fix, was a difference between unix file paths and windows file paths. see line 51 and 54. The "old" code was windows compatible, but caused a problem for unix systems with the security.fileuri .... setting activated. ... So there may be a similar fix for timimi.


current Timimi implementation has a similar issue, which I haven't reproduced yet but I'll check my guess too.

I'll have a closer look, maybe I can help there. The "old" code was windows compatible, but caused a problem for unix systems with the security.fileuri .... setting activated. ... So there may be a similar fix for timimi.


have fun!
mario

Yakov

unread,
Aug 29, 2019, 6:31:59 PM8/29/19
to TiddlyWikiDev
Hi Mario,

thanks for the Unix path fix tip, I'll add it to the next update of Timimi too.

I'll have a closer look at other info too; a quick note for now: could you fix the url calculation to support non-ASCII paths like I've introduced in Timimi? (note encodeURIComponent instead of escape there, in my tests limited to Windows that fixed loading from paths containing non-ASCII symbols and didn't broke anything) Yeah, those bugs and fixes are scattered among various solutions.. that reminds me again that we need docs/common codebase for this, I'll definitely return to that at some point.

Best regards,
Yakov.

четверг, 29 августа 2019 г., 10:47:06 UTC+3 пользователь PMario написал:

Ton Gerner

unread,
Aug 30, 2019, 10:30:07 AM8/30/19
to tiddly...@googlegroups.com
Hi Yakov,

Thanks for your information


you may also be interested in Timimi for TWC, it's quite handy with FF, although the Timimi's advanced backups system is not supported yet for TWC.
 
I am aware of File Backups, Timini, Savetiddlers, TiddlyDesktop, ...
When File Backups had problems with TWc my fallback was TiddlyDesktop. Since that worked with TWc I did not try the others.
Luckily Mario found a solution for File Backups so it does 'work' again.
 

As for your initial problem, try to disable security.fileuri.strict_origin_policy option in your FF's about:config. I suspect that the culprit is recreateOriginal which doesn't take into account some aspects of saver plugins; current Timimi implementation has a similar issue, which I haven't reproduced yet but I'll check my guess too.

I will keep this info in mind for the future; you never know ;-)

Cheers,

Ton

Reply all
Reply to author
Forward
0 new messages