Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bob deletes tiddler when edited via edit-text #194

Open
6 of 10 tasks
tcj-one opened this issue Dec 6, 2022 · 5 comments
Open
6 of 10 tasks

Bob deletes tiddler when edited via edit-text #194

tcj-one opened this issue Dec 6, 2022 · 5 comments

Comments

@tcj-one
Copy link

tcj-one commented Dec 6, 2022

When editing a Tiddler via an edit-text widget in another tiddler, the tiddler being edited will frequently get deleted. This happens regardless of how its being targeted (variable from dropdown or hardcoded) and whether or not the widget itself is hardcoded or generated as part of a macro.

My first hypothesis is that bob is trying to save the modified tiddler every single character, and occasionally steps on itself (sometimes you can go for many seconds without problem).

My first instinct is to increase the save delay (IE wait 30 seconds between changes before saving, not 0). But I'm not sure how to do that, and it would really only be masking over the problem.

Any thoughts?

This is my widget that's causing the issue

<$edit-text tag=textarea class=table-editor-text minHeight=10px tiddler=Test field=effect1/> \end


I am running (check any that apply, put an x inside the [ ] to check a box, like this: [x]):

  • Windows
  • OSX
  • Linux
  • Other

and using

  • The nodejs version
  • The single file executable

Before posting I read issue guidelines and:

  • I am using the newest version
  • The answer to my question isn't listed in the documentation or this isn't
    a question
  • This is not a duplicate issue
  • I have not done anything that required me to set acceptance to
    I Will Not Get Tech Support For This
@simpsoneric
Copy link

simpsoneric commented Dec 21, 2022

I don't want to complicate this issue,
but I am also running into this problem.

My version setup is:

  • Linux
  • nodejs version (TiddlyWiki 5.2.5)
  • TW-Bob version c2e47d0

The error case is:

  • I have tiddler "Foo" open in my browser
  • I edit the tiddler "Foo.tid" using vim on the file system and save it
  • Occasionally "Foo.tid" gets deleted and not re-created after a save
  • Web browser doesn't see it and it is gone from the file system

@tcj-one
Copy link
Author

tcj-one commented Dec 22, 2022

I also had a script running on the server that would scan modified .tid files, and modify them based on the contents. I assumed it was my poor coding that was causing some of those to get deleted, and only discovered my above problem after disabling it. Maybe my code wasn't as poor as I thought.

@simpsoneric
Copy link

simpsoneric commented Dec 22, 2022

Some debugging on my end:

  • I had vim configured to use backup files

This creates files in the mywiki/tiddlers directory with the Foo.tid~ name. I noticed the TW-Bob file system watcher was essentially deleting and watching the same tiddler twice, since their title was identical.

This may have also been a race condition (but I did not spend much time debugging)

  • Two tiddlers had the same title in the tiddlers directory
  • The TW-Bob file system watcher was notified of these two changes
  • They both would race to the fs.unlink() call on local file system changes prior to resaving the tiddler contents to disk

Vim backup files seemed like a bad idea to mix with the TW-Bob file system watcher, so I disabled them.

In addition, I made some code changes I'm trying out at https://github.com/simpsoneric/TW5-Bob/tree/fs_sync_issues

I've run my local setup for the past day and have not run into the deleted tiddler problem.

I'll caveat my changes with my lack of TW-Bob knowledge.
I have only used TW-Bob for a few weeks, and I use it in a single user setup.
I have no idea if my changes break other use cases.

@tcj-one
Copy link
Author

tcj-one commented Dec 24, 2022

I have blindly changed my install to use your repository (after backing up). It's multi-user, but we rarely edit at the same time. I'll let you know if I encounter any issues.

@tcj-one
Copy link
Author

tcj-one commented Dec 24, 2022

EDIT: It looks like I am a fool and failed to switch to your repo.

It looks like the issue still exists. I just lost a tiddler, called "Ruin". Here some logs from during the event.

0|TW5      | sending ack failed
0|TW5      | sending ack failed
0|TW5      | sending ack failed
0|TW5      | Save Tiddler  Ruin
0|TW5      | sending ack failed
0|TW5      | Save Tiddler  Ruin
0|TW5      | Save Tiddler  Ruin
0|TW5      | Deleted tiddler Ruin
0|TW5      | sending ack failed
0|TW5      | deleted file  /appdata/tiddlywiki/TiddlyWiki5/Wikis/X/tiddlers/Ruin_1.tid
0|TW5      | Save Tiddler  Ruin
0|TW5      | sending ack failed
0|TW5      | Deleted tiddler Ruin
0|TW5      | sending ack failed
0|TW5      | deleted file  /appdata/tiddlywiki/TiddlyWiki5/Wikis/X/tiddlers/Ruin_1.tid

0|TW5  | error removing old backup:
0|TW5  | error removing old backup:
0|TW5  | error removing old backup:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants