Can we get "Starting to save" message on save?

I have TW 5.2.2. I use my laptop and several other computers at work via Remote Desktop. I need access to TW from every computer I use, I use lots of tools and take lots of notes on each tool. I store the Tiddlywiki HTML file on a network drive so I can view and edit it from the 1 local and 3 remote computers I use for work.

Problem: on an average day it can take 1-2 minutes to save the file. Sometimes it takes longer to save. I don’t want to click Save more than once while it’s in the process of saving because it will often throw an error.

So when we first start saving the file can TW show a message, and keep it up there, that it is “Starting save”? That would be really helpful.

It’s possible that the save takes so long because our anti-malware package scans the file on every save because it is a self-modifying HTML file.

  1. Wiki HTML file is about 3.5MB in size.
  2. I don’t have a backend server. I just use TW as an HTML file and do edits via Google Chrome.
  3. Tiddlyhost is not an option, it’s blocked by our network.
  4. All our network drives and related stuff is locked down tight so using a .js file somewhere could be problematic.

Thanks!

How big is your wiki?

I think it depends on how your network drive works. There may be a slow connection somewhere but without more details it’s hard to say.

It’s about 3.5MB. Not that big.

There is a “Starting to save” message that appears on screen. It’s duration appears to be controlled by Animation Duration. So when you go to save, you could change Animation Duration (control panel, info, basics) to something like 120000 so the message stays up. You won’t want this setting while you work, because it also controls scrolling to tiddlers, but as a workaround when you need to be sure what’s happening … maybe ?

That makes sense as I set my animation duration to 0. We could still use a different Animation Duration for this save message then. Really I’d like to see the message “Starting to save” as soon as the save button is clicked and keep it there until the file is saved.

You didn’t mention your back-end. Is it a webdav server? Or how does your save work?

I feel like your case might be an outlier. I would consider saving a local copy while I worked, and saving a network copy only at natural break-points (breaks, meetings, updates, etc.).

Edit:

Although 3 megs is small for a file, it might be a lot if its getting AV’d all day. There’s a way to set up TW so the core and plugins are stashed locally and not sent across the network. This means only the parts that aren’t core get sent (which is likely less than 100k).

There’s also a way to set up browser storage so your changes are stored in your local browser. This way you don’t have to save so often and you don’t have to make a local save.

I can elaborate on these solutions if they sound useful.

  • 3rd party app that does plugins.

What saver are you using? Such as Timimi?

This save speed is an issue but you can do things to reduce its impact on you. Consider activating local storage and saving less often, but always save when leaving a device. Perhaps autosave will also reduce the need for you hit save but we need to find a way to autosave less often, not on any change.

Can you use tiddlyhost?

If you can associate .tw files with the browsers you use you may be able save and open your tiddlywiki as a .tw file and avoid the scan. After all html files are oppened in click and .tw files do not unless you set it up.

@TW_jones: I’m using the native saver in Chrome on Windows. I cannot use Tiddlyhost as it seems to be blocked by one of the blocklists our IT uses. I tried it. I can’t mention much more details on that as it’s confidential and IT won’t whitelist Tiddlyhost for me. But my options are limited at work.

I use the simplest options with the least amount of software to install which works on the most number of remote and local machines I use. I use Windows Remote Desktop to get to 2 other machines, plus I use TW on my laptop. So I store the HTML file on a network drive so all my machines have access to the TW file.

Consider activating local storage and saving less often

What is “local storage” as it pertains to TW and how do I set it up? I don’t know what that is.

There is a core plugin for local storage Settings > Plugins > Get more plugins > Local storage.

  • Edited tiddlers get saved localy and as long as you save regularly only recently edited tiddlers (since last save) will be stored in local storage. So you can save a little less often.
  • Search for backup solutions for tiddlywiki you may find tools you can use in your locked down environment.

I think for your usecase local-storage will be problematic. It only stores tiddlers in the browser local-store if they are not saved back to a server. So your tiddlers may end up scattered all over the places in the browser local storage.


IMO you should have a look, if it is possible to use the TW external-core setup. Which uses 2 files a

  • external-5.3.1.html file
  • tiddlywikicore-5.3.1.js

It works like a single-file-wiki if loaded from a network drive, but it only needs to save the HTML portion of the file, which in your case will be about 1MB. The core is about 2.2MB, but it will be cached by the browser.

So loading and saving should be faster.

How to download it

  • Go to: https://tiddlywiki.com/#GettingStarted
    • Click the green Download button, which downloads empty.html
  • Go to: Using the external JavaScript template
    • Click the green Download TiddlyWiki core button.
      It downloads: tiddlywikicore-5.3.1.js
  • Open emtpy.html from your download directory
    • Open $:/config/SaveWikiButton/Template tiddler
    • Change it to: $:/core/save/offline-external-js
  • The empty.html should be saved automatically and it should be about 100kByte

Important

Be aware, that you have 2 files now, that have to be in the same directory

  • empty.html … which relies on
  • tiddlywikicore-5.3.1.js now.

You can run some tests with that configuration and let us know how it works.

have fun!
mario

@mark_s I don’t have a backend server. I just use Google Chrome to save the HTML file on a network drive.

My original post has been updated with some details.

1 Like

If, as an experiment, you use the advanced search, filter tab, “All tiddlers except system tiddlers”, and save to your network as a JSON file, how is the time then?

I’m thinking that because of the complexity of your setup, you might be better saving just your tiddlers as JSON.

The externalise core thing might work, IF all your machines can see the same path name to some directory where the libraries are kept, either on your local machines or on your net drive. That’s the complexity.

@pmario I was not making any suggestion we stop saving, only not so often. Local storage adds a layer of protection, if you do choose to save less often, such as only when leaving the current device.

I observe, that saving to tiddlyhost shows a start and complete save message, this could possibly be tweeked to stay up until done.

  • Next perhaps we could use similar code to meet your requirements.

There doesn’t seem to be a “Starting to save” message for TW 5.2.2 for me for some reason. I even increased my Animation time to 500.

I’m hoping to get another variable which we can update to show the “Starting to save” message for a longer time.

EDIT: I used one of my Tiddlywikis on Tiddlyhost and it’s 5.2.2 and it DOES have a “starting to save” message. But this file, just a plain HTML file with no other fancy savers, does not.

2 Likes

The animation time is in milliseconds. An animation time of 500 is only a half second. On your local machine, your save is probably completed in that time. On TH, save times are slower, leaving the first message on the screen longer.

If you set it to something really large, like 5000 or 10000, you’ll have a better chance of seeing it. But you’ll want to change it back after your experiment, since it also affects the time to scroll to a tiddler.

1 Like

Not really. In my case save often takes about 1 minute for this particular local HTML file on a network drive, sometimes longer, hence the reason for me to want to make that “Starting to save” message last longer. It just doesn’t show at all for this one file.