Timimi icon indicating copy to clipboard operation
Timimi copied to clipboard

TWC file contaminated somewhat

Open PengjuYan opened this issue 6 years ago • 15 comments

Thank you @YakovL and @ibnishak for making Timimi and making it work for TiddlyWiki classic (#23).

Though, there're some problems in the resulting TWC file what the previous plugins (although they don't work any more) won't produce. In short, the original clean TWC file is "contaminated" somewhat. Although it doesn't block TWC or Timimi from working, it's still better if we keep the file content to be original.

If you compare the original clean TWC file and a updated file saved by Timimi, you will see 3 unwanted differences (other than the <storeArea>):

  1. The <title> element is filled in with "My TiddlyWiki - a reusable ...".
  2. The name of injected patch-classic-io.js appears in <head>.
  3. The injected tiddlyfox-message-box <div> appears at the end of <body>.

PengjuYan avatar Jul 20 '19 10:07 PengjuYan

Hi, could you specify the version of TWC you are using? I've tested the latest version of Timimi (modified in dev mode) with 2.9.2 and the message box is removed there, so it's essential to get a way to reproduce the issue to fix it

YakovL avatar Jul 20 '19 11:07 YakovL

I tested by using a freshly downloaded (just downloaded before I did the test) 2.9.2 version. And my FireFox version is 68.0.1 on macOS.

(Just a reminder: As I mentioned in #23, it's possible that "FireFox + approved add-on" and "web-ext FireFox + you local add-on" may behave differently.)

PengjuYan avatar Jul 20 '19 12:07 PengjuYan

Ok, thanks for reporting. Unfortunatelly I probably won't be able to test and start debugging this until Monday; could you test whether the "contamination" is cumulative or not? (open TW, edit, save, reload TW, edit and save again: are those bits added only once or some are added twice?)

YakovL avatar Jul 20 '19 12:07 YakovL

Not cumulative. Just added only once.

PengjuYan avatar Jul 20 '19 12:07 PengjuYan

@YakovL : May I assign this issue to you?

ibnishak avatar Jul 21 '19 02:07 ibnishak

@ibnishak yeap, no problem

YakovL avatar Jul 23 '19 07:07 YakovL

Hi @PengjuYan , could you check whether your FireFox has (in about:config) security.fileuri.strict_origin_policy disabled? I suspect that disabling it will stop contaminating (although won't undo it so you probably need to do that manually)

YakovL avatar Aug 28 '19 20:08 YakovL

Hi @YakovL , I tested by switching security.fileuri.strict_origin_policy from default true to false back and forth, and found that the "contaminating" disappears!

In concrete:

  1. Still there: The <title> element is filled in with "My TiddlyWiki - a reusable ...". This is benign.
  2. Disappeared: The name of injected patch-classic-io.js appears in <head>.
  3. Disappeared: The injected tiddlyfox-message-box <div> appears at the end of <body>.

In other words, the value of security.fileuri.strict_origin_policy doesn't effect the phenomenon. The problem has been fixed automatically (possibly by FireFox 68.0.2 ?).

My settings include:

  1. I'm now using FireFox version 68.0.2 on macOS instead of 68.0.1.
  2. TiddlyWiki classic version 2.9.2 unchanged.
  3. Timimi version 2.0.3 (I'm not sure about the Timimi version when I report this issue, my bad).

Shall I close this issue?

PengjuYan avatar Aug 29 '19 05:08 PengjuYan

have a look at:https://groups.google.com/d/msg/tiddlywikidev/lWlZk9qKUH4/Id66zZhABQAJ

pmario avatar Sep 03 '19 07:09 pmario

@pmario Thank you Mario for pointing me to the discussion there. According to @pmario and @YakovL, seems like the problem lies in recreateOriginal and @pmario solved it in his amazing file-backups (back in 2017 when I was using file-backups I suffered the same problem and I switched to savetiddlers 0.6).

Is there any plan to fix this issue in Timimi for TWC?

I just reproduced this issue by using TWC 2.9.2 + Firefox 75.0 + macOS Catalina (10.15.4) once again.

PengjuYan avatar May 05 '20 14:05 PengjuYan

Will look into it for the next upgrade.

ibnishak avatar May 05 '20 15:05 ibnishak

Couple of notes:

  1. (regarding title) this is actually the expected behavior, title is calced in accord to SiteTitle and SiteSubtitle on saving, this is not a contamination. Well, may be this needs retesting ("My TiddlyWiki - a reusable ..." is in accord to initial SiteTitle and SiteSubtitle values, but it should always be from the current values when they are different from initial ones)
  2. to be retested, the patch-classic-io.js script is expected to be removed from the head. If it is not, it should be investigated and fixed; in Chrome it will be removed slightly differently
  3. tiddlyfox-message-box is something that needs a closer look. First, it should probably be removed in recreateOriginal by TWC core (see backward compatibility notes by Mario in the thread he referenced). Second, I'm not sure if browser extensions should do anything about it. Chrome is very restrictive about XHRs via file:// scheme. Actually, the best approach would be to support file loading functionality by Timimi (backend and extension), but this is not yet something where I can contribute

YakovL avatar May 07 '20 16:05 YakovL

Hi @ibnishak and @YakovL , is there any plan to investigate the issue?

My TWC file keeps add patch-classic-io.js to the <head> section. I will have to open the .html file and clean it manually time by time after many patch-classic-io.js accumulated.

Reproduction environment:

Software Version
TiddlyWiki Classic 2.10.0
Firefox 122.0.1 (64-bit)
macOS 13.0.1

Reproduction result:

  1. Save TWC, then 1.1. A <div> id=tiddlyfox-message-box appears at the end of <body>. 1.2. A <script> with src=patch-classic-io.js appears at the end of <head>.
  2. Save once again, then nothing changes;
  3. Reload the TWC file and save again, then 3.1. Another <script> with src=patch-classic-io.js appears at the end of <head>.

That is to say, the <script> with src=patch-classic-io.js will be accumulated in the TWC file whenever you save it after a reload.

PengjuYan avatar Feb 14 '24 10:02 PengjuYan

Hi Pengju, well it wasn't planned before (or rather was somethere in the middle of my big backlog(s)), but may be I'll take a look for the next release. I've created a TW issue: https://github.com/TiddlyWiki/TiddlyWikiClassic/issues/308; but may be I'll propose a Timimi update as well

YakovL avatar Feb 15 '24 10:02 YakovL

Hi @YakovL , thought you guys have a lot of things to do. Just to remind and hope you put it on the agenda. Never mind and take your time. :-)

PengjuYan avatar Feb 15 '24 15:02 PengjuYan