1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers
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
..
about Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
commands Add new deletetiddlers command 2019-05-30 16:54:57 +01:00
community Update links to Json Mangler plugin github pages (#4388) 2019-12-12 16:48:38 +00:00
concepts Fix syncer to handler errors properly (#4373) 2020-03-30 15:24:05 +01:00
customising Use match operator instead of prefix 2020-01-05 13:54:06 +00:00
definitions Update TiddlyFox docs 2020-01-04 11:20:17 +00:00
demonstrations Incorporate “diff” engine to show visual differences (#3112) 2018-03-16 20:38:35 +00:00
editions Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
features Merge branch 'tiddlywiki-com' 2020-03-30 14:29:55 +01:00
fields Overhaul the filter operator documentation: part 2 2015-01-24 21:18:44 +00:00
fileformats Update release note 2019-06-09 17:09:11 +01:00
filters Merge branch 'tiddlywiki-com' 2020-03-30 14:29:55 +01:00
gettingstarted Docs updates 2017-11-14 12:31:35 +00:00
hellothere Preparing for release of v5.1.21 2019-09-10 16:32:30 +01:00
hiddensettings Update docs for disabling drag and drop 2020-03-20 11:02:14 +00:00
howtos Replace '<<...>>' with a macrocall widget (#4346) 2019-10-24 09:15:52 +01:00
images Preparation for v5.1.22-prerelease 2019-09-10 17:20:36 +01:00
languages Docs typo fix for #3540 2018-11-15 21:44:05 +00:00
learning Clarify drag-n-drop behaviour again (#3434) 2018-11-20 10:06:12 +00:00
macros Fix the datauri macro to work with _canonical_uri tiddlers 2020-03-30 10:55:37 +01:00
mechanisms Extend refresh throttling to tiddlers having a "throttle.refresh" field 2019-10-14 10:42:14 +01:00
menubar First commit of new Menu Bar plugin 2020-02-28 14:33:15 +00:00
messages Docs: bring tm-fold-xxx message docs on par with the code, that is executed. (#4353) 2020-01-30 12:50:19 +00:00
nodejs Merge branch 'tiddlywiki-com' 2020-03-30 14:29:55 +01:00
platforms Rename "Firefox Apocalypse" to "TiddlyFox Apocalypse" 2018-01-08 12:26:47 +00:00
plugins Merge branch 'tiddlywiki-com' 2020-03-30 14:29:55 +01:00
readme Promote Gitter Chat in the Readme (#3322) 2018-12-01 14:25:33 +00:00
reference Add support for splash screens during loading 2018-09-27 09:47:55 +01:00
releasenotes Preparing for release of v5.1.21 2019-09-10 16:32:30 +01:00
roadmap Introduce text editor toolbar (#2315) 2016-04-22 08:36:29 +01:00
saving Merge branch 'tiddlywiki-com' 2020-03-30 14:29:55 +01:00
styleguide Docs updates 2017-03-29 10:19:42 +01:00
system Better readability for "Community" Tiddler with various ... (#4493) 2020-03-12 13:34:59 +00:00
systemtags Add support for $:/tags/Macro/View macros that are only visible within view templates 2020-01-03 10:40:11 +00:00
tiddlydesktop Remove version history of TiddlyDesktop 2018-09-24 09:26:40 +01:00
variables Docs: Clarify use of "actionTiddler" variable 2019-01-18 08:57:08 +00:00
videos Use https for YouTube 2017-11-18 19:53:52 +00:00
webserver Fix syncer to handler errors properly (#4373) 2020-03-30 15:24:05 +01:00
widgets Merge branch 'tiddlywiki-com' 2020-03-30 14:29:55 +01:00
wikitext Merge branch 'tiddlywiki-com' 2020-03-30 14:29:55 +01:00
workingwithtw Extend refresh throttling to tiddlers having a "throttle.refresh" field 2019-10-14 10:42:14 +01:00
$__StoryList.tid Add docs for tm-unload-plugin-library message 2019-10-04 12:37:04 +01:00
AllTiddlers.tid More tag colours 2014-02-25 21:22:21 +00:00
License.tid Docs: fix typos and font-size (#2795) 2020-01-30 12:49:37 +00:00
TableOfContents.tid Rename "configurations" to "platforms" 2015-06-20 09:24:14 +01:00