Safe mode deeper understanding needed

Folks,

I did what I thought was a lot of great tiddlywiki work today, I was very happy with myself until the wiki fails to load correctly.

Instead I see this

The wiki is a copy of tiddlywiki.com, the menubar plugin and my recent design effort.

Opening in safe mode works but attempting to make changes and reload such as setting the menu bar plugin to disabled are not working.

  • I disabled Timimi in the browser and using the default save mechanism

Has anyone seen the above symptom?

Do we have any more comprehensive documentation on making use of the safe mode?

  • I am quite experienced but finding this crisis a little hard to navigate.

In particular what do you do after using safe mode?
Unfortunately the wiki backups are not there, another problem

I have determined the cause in my own code but not precisely yet. But still the debug via safe mode is not strait forward. I hope to document it more, however until I understand it better I do need some help.

  • I am just about to loose a rebuilt wiki because of a problem resulting in Timimi breaking.
  • As a result I need a download button that can save the wiki seperate from the saver, one that captures changes.
    • Something that may be useful on the safe mode tiddler.

Would a download button like this work? I’m not sure how it would behave in safe more, but it should at least let you do a make a downloaded copy if the save button won’t.

1 Like

Thanks Simon for those references.

I did find the method but did not return here until now as I was still trying to fix my broken wiki. If I were evil I may have found a bomb that destroys wikis. But I am yet to uncover the root cause and recover some work I was proud of that may be lost.

Here is my resulting download button with full path in clipboard and filename set.

<$button>
<$action-sendmessage $message="tm-copy-to-clipboard" $param={{$:/info/url/full}}/>
<$action-sendmessage $message="tm-download-file" $param="$:/core/save/all" filename={{{ [{$:/info/url/full}split[/]!last[]join[]] }}}/>
{{$:/PSaT/wiki-info/download-icon}} all 
</$button>

The desire for better documentation on using safe mode remain.

It appears after debugging in safe mode save and reload will take you out of safe mode but you have to reset default tiddlers.

Last resort, Tony, use devtools (F12) to take a copy of the store:

First, highlight the tiddler store and choose Edit as HTML

Then Ctrl+A, and…

Then paste into a text editor (e.g. notepade). Rescue any tiddler {} object that matters.

That’s pretty crude and it may not be everything you’re looking for - maybe someone else has a better way? (I seem to recall @pmario posting something you can use in an emergency but I’m not sure what to search for).

HTH

You could try drag/drop your tiddlywiki html file onto tiddlywiki.com. It should detect the tiddlers and launch the import process. You could deselect all and then only select the one important to you for import.

I found the problem with my wiki and will explain what I did for others passing in the future.

Please continue with ideas for dealing with failures focusing on the Safe mode if possible. Hopefully in the near future I will harvest the knowledge and update https://tiddlywiki.com/#SafeMode

In the end I created a new wiki, took the original into safe mode and dragged and dropped things I wanted to keep in the new wiki, or freshly installed a desired plugin, save and reload as I went to used a process of elimination.

  • Eventually the new wiki failed again when I installed the menubar plugin
    • however the menu bar plugin worked on its own
    • This I started building a new wiki again with the menu bar disabled, install a package, enable and see if it abended again. Eventually I found the package causing the problem.
  • I then created a empty.html + Menu bar plugin and cloned it a few times
    • I then selectively imported parts of the offending package multiple times into different wikis until I identified the problem one.
  • About 10 tiddlywikis were harmed in this debug process :frowning:

In the end it proved to be a “simple custom MenuBar item” in which its custom-menu-content field erroneously contained {{$:/plugins/tiddlywiki/menubar}}

  • It was transcluding the plugin that drives the menu plugin, inside a menu item thet the plugin uses :frowning_face:
  • Most likely a copy to clipboard failed and pasted the previous copy into a field it should not have.

This has being a big time waster and I would argue it was first impacted by insufficient guidance on using safe mode, and then by the complexity of a dual factor fault, it needed both an active menubar plugin AND the particular faulty menu item, in a particular package, at the same time.

I do believe we can improve the safe mode doco enough to reduce troubleshooting time a lot further than actually doing the opposite of getting in the way of debugging.

More details about this would be useful.

Or maybe you could share a simple test case which reproduces the problem so we can drop it onto tiddlywiki.com ourselves and see what makes it difficult to recover from this issue even with the help of safe mode.

Having never used safe mode myself I don’t have any ideas how to improve it or its documentation.

Warning this will Abend your wiki tab

  • On a wiki such as tiddlywiki.com with the $:/plugins/tiddlywiki/menubar installed
  • Create a tiddler tagged $:/tags/MenuBar
  • Give it a fieldname of custom-menu-content with any value, save the tiddler
    • It will appear in the Menu bar
    • This is a minimal menu bar item
  • Now edit your tiddler again but this time change the value of custom-menu-content, such that it transcludes the plugin itself;
    • Such that custom-menu-content = {{$:/plugins/tiddlywiki/menubar}}
    • On tiddler save “Bang” the fault, and you can do very little other than reload and if the changes were saved to file use safemode.
  • One key problem is this can remain silent until the menu bar plugin is installed or enabled, meaning when it happens it ain’t easy to solve.

In fact by transcluding {{$:/plugins/tiddlywiki/internals}} I discovered the problem is the menu grows in size with {{$:/plugins/tiddlywiki/menubar}} you cant see the underlying wiki to repair it.

  • If the menu bar plugin could not extend more than 80% of the View window it is possible to recover from this.
  • I have now discovered you can Zoom Out until the broken menu bar leaves room to see the underlying wiki.

If something is wrong with content in the menu bar that obstructs your view of the underlying tiddler use zoom, such as Ctrl-Mouse Roller or ctrl-+/- untill you can see the underlying wiki and delete the offending tiddler with the $:/tags/MenuBar tag.

See the code at: Last Resort backup solution? - #13 by pmario

@TW_Tones … would it be possible, that you mark one of your posts as “Solution” so other users see, that the problem of the damaged wiki is resolved.

Improving the docs may be an other topic.

@pmario Mario, I have not so far because the OT is outstanding

Safe mode deeper understanding needed

  • Although a rename and repost?