TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.03k stars 1.19k forks source link

[BUG] Blocking javascript console output does not block bdebugging ouput from syncer-browser-tiddlyweb #6339

Open psiloi opened 2 years ago

psiloi commented 2 years ago

Describe the bug A clear and concise description of what the bug is. Blocking javascript console output does not block bdebugging ouput from syncer-browser-tiddlyweb.

To Reproduce Steps to reproduce the behavior:

  1. in the javascript console, type "$tw.syncer.logger.enabled = false"
  2. go to your tiddlywiki plain node.js client page
  3. open or create a tiddler a tiddler
  4. wait a little bit or a little more
  5. you will the following lines appear on the javascript console:
syncer-browser-tiddlyweb: Retrieving skinny tiddler list $:/core/modules/utils/logger.js:52:26 syncer-browser-tiddlyweb: Checking dirty status $:/core/modules/utils/logger.js:52:26 and maybe this one too: syncer-browser-tiddlyweb: Dispatching 'save' task: $:/StoryList wait more and see the first two lines coming again and again. **Expected behavior** nothing should have appeared in the javasrcript console. **TiddlyWiki Configuration (please complete the following information):** - Version 5.2.1 - Saving mechanism Node.js - Plugins installed: none **Desktop (please complete the following information):** - OS: linux debian 11 amd64 - Browser firefox - Version 78.15.0esr **Additional context** this bug is very annoying for debugging one's own code. Also, a more tiddlywiki way to set this debug on or off would be very cool!
psiloi commented 2 years ago

I spotted something that could be of interest about file synchronization here: https://github.com/Inist-CNRS/node-inotifywait. This is aimed at massive and recursive filesystem updates in an effiicient way for javascript. Surely worth a look!

Jermolene commented 2 years ago

Thanks @psiloi the trouble here is that by the time you're typing $tw.syncer.logger.enabled = false, the constructor of the syncer has already setup the logger for the syncadaptor, which is the one issuing the messages you are seeing.

You can disable both in one operation with:

$tw.syncer.logger.enable = false;$tw.syncer.syncadaptor.logger.enable = false;