1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00
TiddlyWiki5/plugins/tiddlywiki
Jeremy Ruston b95723a022
Fix syncer to handler errors properly (#4373)
* First commit

* Add throttling of saves

Now we refuse to save a tiddler more often than once per second.

* Wait for a timeout before trying again after an error

* Modest optimisations of isDirty() method

* Synchronise system tiddlers and deletions from the server

Fixes two long-standing issues:

* Changes to system tiddlers are not synchronised from the server to the browser
* Deletions of tiddlers on the server are not propagated to browser clients

* Make sure we update the dirty status even if there isn't a task to perform

* Replace save-wiki button with popup sync menu

* Remove the "Server" control panel tab

We don't need it with the enhanced sync dropdown

* Add indentation to the save-wiki button

* Fix spacing in dropdown menu items

* Switch between cloud icons according to dirty status

* Add a menu item to copy syncer logs to the clipboard

* Improve animated icon

* Remove indentation from save-wiki button

@pmario the annoying thing is that using `\trim whitespace` trims significant whitespace too, so it means we have to use <$text text=" "/> when we need a space that won't be trimmed. For the moment, I've removed the indentation but will keep thinking about it.

* Further icon, UI and copy text tweaks

Move the icons and styles from the core into the TiddlyWeb plugin

* Clean up PR diff

* Tweak animation durations

* Break the actions from the syncer dropdown into separate tiddlers

@pmario I think this makes things a bit easier to follow

* Refactor syncadaptor creation and logging

The goal is for the syncadaptor to be able to log to the same logger as the syncer, so that the "copy syncer logs to clipboard" data is more useful.

* Don't transition the dirty indicator container colour, just the SVG's colour

* Only trigger a sync for changes to tiddlers we're interested in

Otherwise it is triggered by the creation of the alert tiddlers used to display errors.

* Restore deleting local tiddlers removed from the server

(I had commented it out for some testing and accidentally commited it).

* Guard against missing adaptor info

* We still need to trigger a timeout when there was no task to process

* Avoid repeatedly polling for changes

Instead we only trigger a timeout call at if there is a pending task (ie a tiddler that has changed but isn't yet old enough to save).

* Lazy loading: include skinny versions of lazily loaded tiddlers in the index.html

* Introduce _is_skinny field for indicating that a tiddler is subject to lazy loading

* Remove savetrail plugin from prerelease

It doesn't yet work with the new syncer

* Make the savetrail plugin work again

* Clear outstanding alerts when synchronisation is restored

* Logger: only remove alerts from the same component

Missed off 9f5c0de07

* Make the saving throttle interval configurable (#4385)

After switching Bob to use the core syncer the throttle interval makes saving feel very sluggish compared to the message queue setup that I had before.
The editing lock that I use to prevent conflicts with multiple users doesn't go away until the save is completed, and with the 1 second delay it means that if you edit a tiddler and save it than you have to wait one second before you can edit it again.

* Tweaks to appearance of alerts

* Exclude temp tiddlers from offline snapshots

Otherwise alerts will persist

* Tweak appearance of status line in dropdown

* Update release note

* Web server: Don't include full path in error messages

Fixes #3724

* In change event handler check for deletions

* Disable the official plugin library when the tiddlyweb plugin is loaded

* Hide error details from browser for /files/ route

See https://github.com/Jermolene/TiddlyWiki5/issues/3724#issuecomment-565702492 -- thanks @pmario

* Revert all the changes to the relationship between the syncer and the syncadaptor

Previously we had some major rearrangements to make it possible for the syncadaptor to route it's logging to the logger used by the syncer. The motivation is so that the "copy logs to clipboard" button is more useful.

On reflection, changing the interface this drastically is undesirable from a backwards compatibility perspective, so I'm going to investigate other ways to achieve the logger sharing

* Make the tiddlyweb adaptor use the syncer's logger

So that both are availavble when copying the syncer logs to the clipboard

* Update release note

* Support setting port=0 to get an OS assigned port

Quite useful

* Update code comment

* UI: Use "Get latest changes from server" instead of "Refresh"

* Add getUpdatedTiddlers() method to syncadaptor API

See https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-573579495

* Refactor revision handling within the syncer

Thanks @pmario

* Fix typo in tiddlywebadaptor

* Improve presentation of errors

See https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-573695267

* Add docs for getTiddlerRevision()

* Remove unused error animation

* Update comment for GET /recipes/default/tiddlers/tiddlers.json

* Optimise SVG cloud image

* Add optional list of allowed filters for get all tiddlers route

An attempt to address @Arlen22's concern here:

https://github.com/Jermolene/TiddlyWiki5/pull/4373#pullrequestreview-342146190

* Fix network error alert text translatability

* Fix error code and logging for GET /recipes/default/tiddlers/tiddlers.json

Thanks @Arlen22

* Flip GET /recipes/default/tiddlers/tiddlers.json allowed filter handling to be secure by default

* Validate updates received from getUpdatedTiddlers()

* Add syncer method to force loading of a tiddler from the server

* Remove the release note update to remove the merge conflict

* Fix crash when there's no config section in the tiddlywiki.info file

* Use config tiddler title to check filter query (merge into fix-syncer) (#4478)

* Use config tiddler title to check filter query

* Create config-tiddlers-filter.tid

* Add config switch to enable all filters on GET /recipes/default/tiddlers/tiddlers.json

And update docs

* Fix bug when deleting a tiddler with a shadow

Reported by @kookma at https://github.com/Jermolene/TiddlyWiki5/pull/4373#issuecomment-604027528

Co-authored-by: jed <inmysocks@fastmail.com>
Co-authored-by: Arlen22 <arlenbee@gmail.com>
2020-03-30 15:24:05 +01:00
..
async Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
aws Use the dependents and parent-plugin fields to automatically install dependencies 2019-09-25 21:57:22 +01:00
bibtex Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
blog Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
browser-sniff Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
browser-storage Browser-storage plugin: Don't save popup state by default 2020-02-19 18:58:13 +00:00
cecily Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
classictools Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
codemirror Fix: remove cancelPopups from codemirror engine (#4310) 2019-10-12 16:40:51 +01:00
codemirror-autocomplete Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-closebrackets Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-closetag Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-fullscreen-editing Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-keymap-emacs Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-keymap-sublime-text Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-keymap-vim Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-mode-css Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-mode-htmlembedded Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-mode-htmlmixed Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-mode-javascript Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-mode-markdown Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-mode-x-tiddlywiki Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-mode-xml Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
codemirror-search-replace Introduce "parent-plugin" field to control how plugins are displayed in the chooser 2019-09-25 16:16:28 +01:00
comments Fix comment plugin typo 2019-11-02 12:37:07 +00:00
d3 Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
dynannotate Introducing "Dynannotate" plugin for overlaying annotations 2020-03-11 16:55:19 +00:00
dynaview Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
evernote Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
external-attachments Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
filesystem Fix syncer to handler errors properly (#4373) 2020-03-30 15:24:05 +01:00
freelinks Freelinks: Add note about customising within which tiddlers are freelinked 2020-01-04 17:02:00 +00:00
github-fork-ribbon Simplify GitHub fork ribbon plugin metadata 2019-10-14 13:19:27 +01:00
googleanalytics Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
hammerjs Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
help Fix broken filters introduced in b179a6011 2020-02-29 15:56:22 +00:00
highlight Highlight Plugin: Update readme to reflect version change (#4503) 2020-03-14 17:16:38 +00:00
innerwiki Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
internals Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
jasmine Upgrade to Jasmine 3 (#4226) 2019-11-12 21:42:38 +00:00
jszip Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
katex Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
markdown Markdown plugin: Description notes remarkable instead of markdown-js (#4422) 2020-03-02 09:29:16 +00:00
menubar Menubar: Fix positioning of toprightbar when narrow 2020-03-24 10:35:07 +00:00
mobiledragdrop Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
nodewebkitsaver Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
pluginlibrary Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
powered-by-tiddlywiki Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
qrcode Use match operator instead of prefix 2020-01-05 13:54:06 +00:00
railroad Railroad plugin: Use message box colours so that they change with the palette 2020-01-30 12:16:29 +00:00
savetrail Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
sax Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
share Share plugin: Add prominent warning in readme 2020-02-28 14:28:08 +00:00
stacked-view Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
tahoelafs Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
text-slicer Use match operator instead of prefix 2020-01-05 13:54:06 +00:00
tiddlyweb Fix syncer to handler errors properly (#4373) 2020-03-30 15:24:05 +01:00
translators Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
tw2parser Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
tw5.com-docs Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
twitter Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
upgrade Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00
xlsx-utils Use the dependents and parent-plugin fields to automatically install dependencies 2019-09-25 21:57:22 +01:00
xmldom Improve plugin metadata, and add a "name" field 2019-09-19 13:04:10 +01:00