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

watch-fs stuck in unknown loop #8

Closed
xeor opened this issue Sep 15, 2020 · 7 comments
Closed

watch-fs stuck in unknown loop #8

xeor opened this issue Sep 15, 2020 · 7 comments

Comments

@xeor
Copy link

xeor commented Sep 15, 2020

I'm using the kookma favorites plugin (https://github.com/kookma/TW-Favorites), and noticed that when I toggled favorite status of a tiddler, watch-fs got stuck in a loop.

The files /tiddlywiki/data/tiddlers/$__favorites_favlist.tid and /tiddlywiki/data/tiddlers/$__plugins_kookma_favorites_recent.tid is not being changed between each iterations.

I'm not sure if this is a problem with the favorites plugin, or if there are a general bug in watch-fs. I'll update the issue if I figure out some more

Here is an example of 2 iterations of the loop.

 syncer-server-filesystem: Dispatching 'save' task: $:/favorites/favlist
 syncer-server-filesystem: Dispatching 'save' task: $:/plugins/kookma/favorites/recent
$__favorites_favlist.tid update
tiddlersDescriptor {
  "filepath": "/tiddlywiki/data/tiddlers/$__favorites_favlist.tid",
  "type": "application/x-tiddler",
  "tiddlers": [
    {
      "title": "$:/favorites/favlist",
      "created": "NaNNaNNaNNaNNaNNaNNaN",
      "list": "aaa [[something]]",
      "modified": "20200915193938719",
      "type": "text/vnd.tiddlywiki"
    }
  ],
  "hasMetaFile": false
}
updating existed tiddler $:/favorites/favlist
Saving updated $:/favorites/favlist
canSync is now false
$__plugins_kookma_favorites_recent.tid update
tiddlersDescriptor {
  "filepath": "/tiddlywiki/data/tiddlers/$__plugins_kookma_favorites_recent.tid",
  "type": "application/x-tiddler",
  "tiddlers": [
    {
      "title": "$:/plugins/kookma/favorites/recent",
      "caption": "Recently added",
      "created": "NaNNaNNaNNaNNaNNaNNaN",
      "creator": "a revised version of Andrew Harrison favorite plugin",
      "list": "aaa $:/plugins/kookma/favorites/styles/image.css",
      "modified": "20200915193938750",
      "modifier": "a revised version of Andrew Harrison favorite plugin",
      "tags": "$:/tags/Favorites/Folder",
      "type": "text/vnd.tiddlywiki"
    }
  ],
  "hasMetaFile": false
}
updating existed tiddler $:/plugins/kookma/favorites/recent
Saving updated $:/plugins/kookma/favorites/recent
canSync is now false

//// Next iteration starts here...

 syncer-server-filesystem: Dispatching 'save' task: $:/favorites/favlist
 syncer-server-filesystem: Dispatching 'save' task: $:/plugins/kookma/favorites/recent
$__favorites_favlist.tid update
tiddlersDescriptor {
  "filepath": "/tiddlywiki/data/tiddlers/$__favorites_favlist.tid",
  "type": "application/x-tiddler",
  "tiddlers": [
    {
      "title": "$:/favorites/favlist",
      "created": "NaNNaNNaNNaNNaNNaNNaN",
      "list": "aaa [[something]]",
      "modified": "20200915193938719",
      "type": "text/vnd.tiddlywiki"
    }
  ],
  "hasMetaFile": false
}
updating existed tiddler $:/favorites/favlist
Saving updated $:/favorites/favlist
canSync is now false
$__plugins_kookma_favorites_recent.tid update
tiddlersDescriptor {
  "filepath": "/tiddlywiki/data/tiddlers/$__plugins_kookma_favorites_recent.tid",
  "type": "application/x-tiddler",
  "tiddlers": [
    {
      "title": "$:/plugins/kookma/favorites/recent",
      "caption": "Recently added",
      "created": "NaNNaNNaNNaNNaNNaNNaN",
      "creator": "a revised version of Andrew Harrison favorite plugin",
      "list": "aaa $:/plugins/kookma/favorites/styles/image.css",
      "modified": "20200915193938750",
      "modifier": "a revised version of Andrew Harrison favorite plugin",
      "tags": "$:/tags/Favorites/Folder",
      "type": "text/vnd.tiddlywiki"
    }
  ],
  "hasMetaFile": false
}
updating existed tiddler $:/plugins/kookma/favorites/recent
Saving updated $:/plugins/kookma/favorites/recent
canSync is now false
@xeor
Copy link
Author

xeor commented Sep 15, 2020

A simple

<$button>
<$action-setfield $tiddler="$:/favorites/favlist" list="aaa"/>
trigger loop
</$button>

will trigger the loop (and wipe out favorite list, beware!).

However, changing to any other path, example $:/favorites/favlist2 doesnt trigger the loop. So I guess it might be the favorite plugins mistake. This loop also happens when changing any of the settings of this favorite plugins..

@linonetwo
Copy link
Collaborator

Normally changes from the browser will be ignored, so their change to the disk won't trigger another change in the browser, causing a loop.

Seems in this case the change from browser is not properly ignored?

I have the favorite plugin installed, but I haven't use it at least once...So I didn't know this before.

@xeor
Copy link
Author

xeor commented Sep 16, 2020

I did see this issue once a couple of days with another plugin as well.. I don't remember which one, and I can't reproduce it. But yea, there might be some edge cases that isn't probably ignored then.

So you where able to reproduce?

@linonetwo
Copy link
Collaborator

This seem to be fixed now! Just by fixing #7

@xeor
Copy link
Author

xeor commented Oct 5, 2020

It still happens when I'm testing the new version. I'll investigate some more. Are you on 5.1.22?

@linonetwo
Copy link
Collaborator

linonetwo commented Oct 8, 2020

No, I'm using https://www.npmjs.com/package/@tiddlygit/tiddlywiki 5.1.23-prerelease.20201003-fix-file-info

I need some new feature from the new tw.

@linonetwo linonetwo reopened this Oct 8, 2020
@linonetwo
Copy link
Collaborator

Well... Not using watch-fs now, I mostly manually reload the nodejs wiki, it don't consume too much time...

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