Options not saving

76 views
Skip to first unread message

AndrewMc

unread,
Nov 16, 2024, 4:49:21 AM11/16/24
to TiddlyWikiClassic
Hi All

I have been trying to set up a new TWc on a local disk. However, after saving my changes when I re-open the TW file, the options like the username and the folder to use for backups have not been saved. I have tried many things, but the options do not save. I believe that these options should be saved as cookies under the name "TiddlyWikiClassicOptions".

My test procedure is as follows:

Test procedure

  1. Open new TWc 2.10.1 file in browser
  2. Edit the [[SiteTitle]] and [[SiteSubtitle]]
  3. Set the username
  4. In options: uncheck EnableAnimations
  5. In advanced options: set name of folder to use for backups to “twcbackup”
  6. Click on [save changes]
  7. Close browser
  8. Re-open browser and open the saved TWc file
I have tried the Firefox browser on both Windows 11 and Linux Mint. I have tried Firefox in Troubleshooting Mode (so that all extensions are disabled), with only the Timimi extension enabled, and with Timimi either set to make no backups or to use the Tower of Hanoi backup strategy.

Each time I re-open the saved TW file, I can see the saved changes to the title and subtitle, but none of the options are saved. They are all back to the defaults.

Obviously I must be doing something wrong. :-( Can anyone give me directions so that I can save my local TW files along with their options?

Cheers
Andrew Mc

Yakov

unread,
Nov 16, 2024, 5:24:20 AM11/16/24
to TiddlyWikiClassic
Hi Andrew,

I think the most common issue that prevents saving options is an "overflow" of cookies. Several factors contribute to this:
  • for localhost urls and, if I recall correctly, for file:// urls, browsers don't "scope" cookies, i.e. cookies saved for one localhost url are also used in all other localhost urls, hence their size "sum up";
  • beside TiddlyWikiClassicOptions, you may have leftovers of cookies from old TWc versions, i.e. TiddlyWiki and TiddlyWikiOptions (or TiddlyWikiClassic, I'm not 100% sure at the moment) – and also you may have other applications working on localhost, like Duplicati for example;
  • before 2.10.1, TWc had no notion of "default option value" and saved default values to cookie while that's not necessary – again, you may have the cookie bloated with defaults from TWs of previous versions;
  • you may use custom options intensively if you add them to many sliders or tabs which is an easy way so reach the limit (somewhat about 4K characters, but it's not a standardized value, if I remember correctly).
A typical workaround (when you don't want to check what's inside your cookies and optimize them) is to use SystemSettings to "bake" options like txtUserName (by adding a line like txtUserName: my name) etc (or use simple plugin like config.options.txtUserName = "my name"). But you also can update all your TWs to 2.10.1 and then clean up cookies (I can guide on using DevTools to that).

Best regards,
Yakov.

суббота, 16 ноября 2024 г. в 12:49:21 UTC+3, AndrewMc:

AndrewMc

unread,
Nov 18, 2024, 3:49:58 AM11/18/24
to TiddlyWikiClassic
Hi Yakov

I have tried to investigate the cookies on my system. On Windows 11, in Firefox, under Settings > Privacy and Security, I can click on [Manage Data] for "Cookies and Site Data", and see the list of sites with cookies. Unfortunately, there is no listing for "file" or "localhost". I have viewed the cookies.sqlite file in an online viewer and found several listings for cookies starting with "Tiddly", but these are all external sites like TiddlyHost or TiddlySpot, or some github.io sites used by plugin creators. So, I cannot yet see where the local file TWc cookies are stored.

If I open one of my long time TWc files in Firefox, under the developer tools, I can see an array of 56 values stored in TiddlyWikiClassicOptions. I presume that many of these are the default options. If I start Firefox and open an empty TWc 2.10.1, I can see only one cookie value, txtMainTab: "Timeline".
However, if I open the existing TW file with many cookie values, call it "wiki A", and then open a new TW 2.10.1 in another tab (call it "wiki B"), then the new wiki B shows all of the same options as wiki A. So, it seems that the cookies from one file:// are shared by another file://.

When I open the file with cookies, wiki A, in Chrome or MS Edge, there are no cookies shown in the developer tools. I can only see cookie values for a local file TWc when opening the file in Firefox.

For now, I have used the [[SystemSettings]] tiddler to force certain settings to be applied.

Cheers
Andrew Mc

Yakov

unread,
Nov 20, 2024, 2:02:01 AM11/20/24
to TiddlyWikiClassic
Hi Andrew,

in the dev tools in the storage tab, you can look up the size of your current cookies, see the screenshot:

cookies.png

If it is, like mine, close to or over 4K, then you can have problems with overwriting such a cookie.

I guess, we should probably have a check in the core in one of the options/cookie saving methods that will allow to tell users if saving was insuccessful, why, and what they can do about it. If you wish to help with that, let's first analyse the sizes of the cookies that you have for file://.

Best regards,
Yakov.
понедельник, 18 ноября 2024 г. в 11:49:58 UTC+3, AndrewMc:

AndrewMc

unread,
Nov 23, 2024, 4:45:02 PM11/23/24
to TiddlyWikiClassic
Hi Yakov

My TWc file with many saved values has a size of 1798 bytes.
A new empty TWc 2.10.1 has a size of 49 bytes.

Yes, I am happy to help with investigating this issue. Let me know what you need.

Cheers
Andrew Mc

Yakov

unread,
Dec 11, 2024, 11:05:02 AM12/11/24
to TiddlyWikiClassic
Thanks, Andrew,

First, correct me if I'm wrong with this summary:
  1. You're using Windows 11, a contemporary Firefox version (that is, something near 133);
  2. Both your old big (wiki A) and new empty (wiki B) TWs are 2.10.1 (if not, what's the version of wiki A?);
  3. Options are not saved for wiki B (like type user name, save, reload tab → user name is back to default); are they saved for wiki A? (like change user name, save, reload tab → the changed name is set);
  4. You have no "baked" options in the old TW (well, seems to be true as you say that in other browsers those options are set back to defaults);
  5. Cookies for wiki A is shown to be 1798 bytes big.
I think the question in 3. is the most important one: if the option is not updated, please also check if the cookie is "TiddlyWikiClassicOptions" (and if there's any old cookie: either "TiddlyWiki" or "TiddlyWikiOptions").

Best regards,
Yakov

воскресенье, 24 ноября 2024 г. в 00:45:02 UTC+3, AndrewMc:

AndrewMc

unread,
Dec 15, 2024, 2:10:38 AM12/15/24
to TiddlyWikiClassic
Hi Yakov

1. Yes, I am testing on Windows 11 using a current version of Firefox (133) with Timimi.
2. Yes, both the old, big (wiki A) and new empty (wiki B) TWs are 2.10.1.
3. I need to clarify. With wiki B, after [save changes], if I reload the tab by pressing [F5] the changes (e.g., to username) remain and are still there. However, if I close the browser and then reload wiki B, then the changed options are reset to the defaults (e.g., username  is "YourName").
4. No. I am embarrassed to admit that I didn't check for SystemSettings in wiki A :-(, but it has a SystemsSettings tiddler containing six settings. When I remove the SystemSettings tiddler by renaming it, then wiki A behaves in exactly the same way as wiki B. If I close the wiki A tab (or the browser entirely) and re-open it, the username (and other options) are reset to the default.
I looked further and found that since my TW is based on an old version of MPTW, there are a number of settings baked in by MPTW. These settings help contribute to the large size of the TiddlyWikiClassicOptions cookie for wiki A (1798 bytes).

So, I have discovered that when using Firefox with Timimi on Windows 11 (and also on Linux Mint), changes to tiddlers are saved, but changes to options (like txtusername, chkAnimate, etc) are not. The only way that I know  to make options persist between browser sessions is to "bake" the settings in by using a tiddler like SystemSettings.

Yakov, I apologise for not checking for baked in settings earlier. If I had it would simplify the question to: "Using Firefox, are TW options saved in cookies that persist between sessions?". The answer I have so far is, "No, they do not persist. They must be baked in to be kept between browser sessions".

Cheers
Andrew Mc

Yakov

unread,
Dec 23, 2024, 3:11:34 AM12/23/24
to TiddlyWikiClassic
Hi Andrew,

right, thanks for summarizing. This is still unexpected (with the cookies' size below 2K) and is indeed a poor user experience (a lot of confusion). Your conclusion

> Using Firefox, are TW options saved in cookies that persist between sessions?
> No, they do not persist. They must be baked in to be kept between browser sessions.

may be extended like this:

> They are expected to persist, but the do not (unless baked).

I think that we should shift from using cookies to using localStorage in the future (with a fallback to cookies, at least reading them) as its support is quite universal and it doesn't have the "limit" problem. It will require some research regarding scoping and backward compatibility, though.

For the record (so that I can try to reproduce): in you cases and experiments above, did you open TWs
a) only through file:// urls,
b) only through http(s):// urls (localhost?), or
c) it was different in different cases?

воскресенье, 15 декабря 2024 г. в 10:10:38 UTC+3, AndrewMc:
Reply all
Reply to author
Forward
0 new messages