TiddlyDesktop icon indicating copy to clipboard operation
TiddlyDesktop copied to clipboard

Wiki folder editing is broken

Open Vhou-Atroph opened this issue 2 years ago • 8 comments
trafficstars

I've been using TiddlyWiki for a couple years, and finally decided to try out wiki folders. I use TiddlyDesktop as a way to edit my wikis, and have found a couple issues in regards to how it works with wiki folders specifically.

Editing a tiddler and then exiting out of it through any means (closing draft, deleting tiddler, saving edits) creates a completely blank object in the story river.

The steps to reproduce this are:

  1. Open wiki folder
  2. Create a new tiddler
  3. Close draft
  4. A blank object should remain in the story river.

bug

This happens every time an individual edits a tiddler regardless of whether it already exists or not, and this can happen multiple times within one session. The only way to remove the objects is to close and re-open the wiki.

Vhou-Atroph avatar Sep 28 '23 20:09 Vhou-Atroph

Thank you @Vhou-Atroph I can confirm that I'm seeing the same problem. Looking at the developer console there are a number of JS errors. I'm investigating.

Jermolene avatar Sep 30 '23 12:09 Jermolene

https://github.com/Jermolene/TiddlyWiki5/pull/8007 may fix this once it's been merged into TiddlyWiki. To test that fix before that PR is merged, do the following:

  • Close any wikis you may have open in TiddlyDesktop, and exit TiddlyDesktop
  • Find your TiddlyDesktop install location
  • Open the tiddlywiki folder inside TiddlyDesktop
  • Open the boot folder and edit boot.js with a text editor: VS Code if you have it, but Notepad will work in a pinch
  • Search for the text sjcl. You should find var sjcl = ... inside a $tw.utils.Crypto function
  • Add a line saying $tw.sjcl = sjcl, right above the this.setPassword = ... line
  • Save the file and exit the text editor
  • Now go back to the tiddlywiki folder, and open up core, then modules, then filters
  • Edit the crypto.js file
  • In the line that starts with return sjcl.codec.hex ..., there are two occurrences of sjcl. Replace both of them with $tw.sjcl, leaving the rest of the line unchanged.
  • Save the file and exit the text editor
  • Restart TiddlyDeskop and reopen your wiki folder(s)
  • Try adding a new tillder, and it should work as expected now

rmunn avatar Feb 26 '24 01:02 rmunn

@rmunn Can confirm this fixes the issue- thank you!

Vhou-Atroph avatar Feb 26 '24 01:02 Vhou-Atroph

Thanks @rmunn I'll build a new prerelease of TiddlyDesktop as soon as I get the chance. (We could do with CI on TiddlyDesktop).

Jermolene avatar Feb 26 '24 11:02 Jermolene

(We could do with CI on TiddlyDesktop).

I've just created https://github.com/TiddlyWiki/TiddlyDesktop/pull/289 as a first attempt at getting some kind of CI set up. It's only a first draft and probably shouldn't be used exactly as-is (for example, it uses the existing bld.sh scripts when a better solution would be to run six builds in parallel, one for each supported architecture). But hopefully it may save you some time in getting CI set up, by having a starting point to work from instead of starting from scratch.

rmunn avatar Feb 27 '24 05:02 rmunn

I believe this is fixed in the v0.0.20 release. @Vhou-Atroph can you confirm that v0.0.20 fixes this, then close the issue?

rmunn avatar Mar 04 '24 01:03 rmunn

@rmunn, the issue persists on my new download of v0.0.20.

Opening the boot.js file, I do not see the changes made in your original fix. crypto.js similarly does not have the same fixes.

After a little investigation, it seems the boot.js bundled with the latest version of TiddlyDesktop looks identical to the version from the release of TiddlyWiki 5.3.0. For reference, here's an online comparison between the two files. The copy of boot.js from TiddlyWiki 5.3.0 is shown on the left, and the copy bundled with TiddlyDesktop 0.0.20 is shown on the right.

Vhou-Atroph avatar Mar 04 '24 03:03 Vhou-Atroph

Looks like the package-lock.json file is keeping the tiddlywiki version at commit 5c5543815b66c95938862a4db71cf6ea36cfe143, and npm install isn't updating the verison of a Git repo dependency the way I'd have expected it to.

@Jermolene, next time you prepare a TiddlyDesktop release, you might need to put a commit hash into the package.json file explicitly, e.g. 984863065ecc6ca7cd6609fd27da7845abc386f7 to get the commit where my bugfix was merged in, or 070327cb5708cfad104e2f325115203b499af631 to get the current most recent TiddlyWiki5 commit.

rmunn avatar Mar 04 '24 03:03 rmunn

@Vhou-Atroph - Could you test a TiddlyDesktop prerelease to see if it fixes the bug? At https://github.com/TiddlyWiki/TiddlyDesktop/actions/runs/8185198661?pr=296 you should see a bunch of release candidates for v0.0.21. (Due to a quirk of the GitHub Actions build process that I can't work around, they will be .zip.zip files, i.e. a .zip file that contains a .zip file that contains the actual release candidate. Don't worry, the eventual release will not be double-zipped). Could you download the one that works for your system (win64, linux64, whatever) and test that it finally does fix this bug? Thanks!

rmunn avatar Mar 07 '24 09:03 rmunn

@rmunn I can confirm that the bug has been fixed in the actions build you have linked.

I'll preemptively close the issue here ahead of a full release. Thank you once again!

Vhou-Atroph avatar Mar 07 '24 16:03 Vhou-Atroph