-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add server sent events #5279
Add server sent events #5279
Conversation
5e2be7d
to
5b90300
Compare
5b90300
to
4573d8c
Compare
@Jermolene ... bump |
4573d8c
to
ffa2141
Compare
@Jermolene are there any changes you'd like me to do? |
469dbef
to
979b3ee
Compare
@Jermolene I just rebased the branch. I can also rerwite the history if that's too many commits (I kept the commits from @Arlen22 but I can squash some of them to make the history cleaner). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @NicolasPetton apologies for the delay. Although I've been merging new stuff as it pops up, I haven't yet had a chance to methodically go back through the tickets we identified in #5231.
There's a couple of minor coding style comments. I'm also wondering if we need a configuration setting to turn off the SSE server; it could conceivably be a vector for DDOS attacks. We also need documentation updates.
Finally, I'm wondering if it's worth merging this without updating the syncer/syncadaptor to take advantage of it.
I'll fix them.
Would you accept that improvement in a separate PR?
Would you like documentation updates as part of this PR? If so, could you point out which tiddlers need updating?
Sorry, I'm not following. The PR adds a route |
@Jermolene from the OP
I think it does take advantage of the new funtionality |
I think the configuration may be a new parameter to the For compatibility and security reasons, it may be switched OFF by default. So if the new parameter is present it will be switched on |
Thanks.
It's generally best to include the docs in the same PR but we do fairly often merge them separately.
The integration with the syncer is primitive; the client calls |
That makes sense. The client will need to be able to run correctly with either setting. |
41ba026
to
1e70cfb
Compare
* Extract helper functions for handling wikis and connections. * Replace JSDoc comments. * Fix formatting according to TW core. * Simplify the logic for adding and removing connections.
Fix formatting according to TW core.
Fix formatting and comments following TW core guidelines.
startsWith is part of ES2015, while TiddlyWiki uses the 5.1 dialect.
* If not set to "yes", disabled SSE request handling. * Add documentation for the parameter in core/language/en-GB/Help/listen.tid * Add new tiddler editions/tw5.com/tiddlers/webserver/WebServer Parameter_ sse-enabled.tid
* Add sse_enabled to /status JSON response * Store syncer polling status in $:/config/SyncDisablePolling * Handled disabling polling in core/modules/syncer.js
1e70cfb
to
5a9ae03
Compare
@Jermolene I've fixed all the styling issues, plus:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me
Bravo, and thank you @NicolasPetton looks great. |
Wow, amazing feature, will this make #3060 possible? |
As discussed in #5853 (comment), I'm reverting this PR in favour of a slightly different approach: we will add the hooks required to enable SSE implementations to be undertaken in plugins. |
Apologies, to clarify that the reverting is being done in #5853 |
This reverts commit 17b4f53 according to Github Desktop. git checkout that commit revert commit in GitHub Desktop git switch -c revert-sse uncommit in Github Desktop switch to master, bringing changes resolve deletions with command line
@linonetwo ... You can user curl or an other tool to send new files to the server instead of creating them with an editor. So if the serve gets the info about new tiddlers that way all the syncing should be done automatically. See the discussion on GG |
This is a follow-up to the original PR by @Arlen22 here: #4609.
Original PR description
This is related to Issue #4608 and also fixes Issue #4605.
To test this, run node tiddlywiki.js editions/server --listen then open two pages side-by-side and watch changes propagate in almost real time.