felixhayashi / TW5-TiddlyMap

Map drawing and topic visualization for your wiki
http://tiddlymap.org
BSD 2-Clause "Simplified" License
838 stars 126 forks source link

RSOD with TW v5.3.5-pre - missing type #457

Closed pmario closed 1 month ago

pmario commented 1 month ago

@flibbles -- There has been a Talk thread, where etardiff points out a problem with TiddlyMap.

I did find the issue and I think why it happened. The problem is caused at: https://github.com/felixhayashi/TW5-TiddlyMap/blob/2f0a2779c342a3bf1b9e91539296b07b023391d3/src/plugins/felixhayashi/tiddlymap/js/edgeTypeSubscriber/AbstractRefEdgeTypeSubscriber.js#L65 because the type: tm-body:transclusion (or similar) is new in TW v5.3.4+ -- It seems TiddlyMap recognises the new "transclusions" and "backtransclusions", but does not know, what to do with it.

I think I do have a fix. -- But I also needed to fix the gulp tasks because I did get an error message there. too.

So do you accept PRs, once I'm sure it actually works?

flibbles commented 1 month ago

I'm pretty sure I'm able to merge PRs. Oh man. I can't believe that code is actually being used now. I added handling for transclusion edges to TiddlyMap almost 8 years ago, and I pushed a PR to Tiddlywiki for the core's side of it. I think I gave up on it ever being merged.

pmario commented 1 month ago

Are you able to build the stuff, with the current setup? --- I did get some problems.

I'll post a PR that seems to work for me and you can have a closer look. From the PMs at Talk it seems it works for etardiff too.

novo-redeunt commented 1 month ago

Hello! Let me first express my appreciation for the work you are doing in general and TiddlyMap in particular. It has become an important part of my TiddlyWikis.

Is there any roadmap to release a new version of TiddlyMap with the RSOD fix? Or did I miss something?

flibbles commented 1 month ago

I was really hoping to get a reply from @pmario about the version change, and maybe about the sass stuff.

Also, I'm not able to replicate this bug. What do you do? You just have tiddlymap on a wiki, and you delete tiddlers that would be on the map? I'm not seeing that.

So yeah, sorry. This one fell of my plate. I'll try and look into it again today.

flibbles commented 1 month ago

Yeah, I'm still not able to replicate this. Which makes me a little reluctant to go forward with the PR. TiddlyMap doesn't have any testing framework, and without any sense of what I'm changing, if that fix is just fixing a symptom or if it's the actual fix, I'd like to have some idea before generating a new build.

pmario commented 1 month ago

Here is how to replicate the problem

It does delete the tiddler. The RSOD comes from the function I linked to in the OP

novo-redeunt commented 1 month ago

Here is how to replicate the problem

  • Download empty.html from tw-com GettingStarted
  • Download TiddlyMap from https://tiddlymap.org/ with the standard Save-Button
  • Drag and drop import TiddlyMap into empty.html
  • save and reload
  • Create a new standard tiddler with +
  • Save tiddler
  • Delete the tiddler from the Tiddler More tab -> RSOD after "are you sure" dialogue
  • Edit Tiddler -> Delete Button -> RSOD after dialogue

It does delete the tiddler. The RSOD comes from the function I linked to in the OP

Confirmation from my side.

flibbles commented 1 month ago

So the problem was that the tw-body:transclude edge type wasn't fully implemented. What happened is:

  1. Felix and I added some of the framework for a transclude edge type.
  2. We introduce a getTiddlerTranscludes PR to Tiddlywiki which is required for the edge type to work.
  3. 8 years go by.
  4. the getTiddlerTranscludes method gets added independently by someone else in an unrelated discussion thread.
  5. I have long since forgotten that there was a second part to the transclude edge type that I needed to implement.

I have completed the implementation. I have chosen darkgreen as the color. Tiddlywiki projects that create new views will have transclude edges disabled just as it has link edges disabled, but migrating projects with pre-existing views may need to add -[[tw-body:transclude]] to their Edge-type filter.

The latest release shouldn't have the crash.

Edit: The reason it took me so long to replicate this bug is because I long, long ago implemented the second half of transclude edges for myself, and I had forgotten I'd done so.