-
Notifications
You must be signed in to change notification settings - Fork 12
Added realtime updates #78
Added realtime updates #78
Conversation
Thank you for this pull request. The usage of server side events is an interesting approach which might solve a lot of (future) problems with the gui connection. To start, I want to integrate the But first, we have to discuss the API interface. We used to send the auth key as header field. In your definition, your sendind it as parameter. Is this a limitation of the EventSource? b66b821#diff-be1fae0b59ee0da30023b30b6b25854eR15 I'm also not understanding the comment completely: After we solved this, I will include the |
And we should include a big warning, when the EventSource API is not supported because it will probably be used for more when we're ready. Still good support though. |
Depending on the future use cases, it might make sense to use websockets instead, which would also solve the IE/Edge support. The comment about the Accept-header is just a hint that this value is expected and testing if the client expects a long running event stream. If the request does not include this header, it will be rejected: https://github.com/codeoverflow-org/chatoverflow/pull/78/files#diff-3acd087eb793d2cd5e40247c8f9a4379R48 |
I would use SSE for the same reasons. But you're right, it's not compatible to swagger / open api: OAI/OpenAPI-Specification#396 The hint with the accept header is good idea. Beeing unable to set the authkey in the header is not the best, but I also agree that params are easier then cookies here. |
I updated the npm package. PluginInstance contains now the log field by default, and the API contains an event endpoint following your controller definitions. I also updated the gui to match the new specifications and types. https://www.npmjs.com/package/chatoverflow-api The usage of events is useful for future versions of the gui, probably for more than just instances and log events. There are a few more things to do:
That's all. I'm looking forward to integrate this feature when you're ready! |
Everything is fine. Thank you for this great addition! |
Sends live events to the gui using server sent events.
Currently contains start/stop and log of instances.
Based on Issue #74.