Skip to content
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

Replace websockets with polling #106

Open
FoxxMD opened this issue Sep 1, 2022 · 2 comments
Open

Replace websockets with polling #106

FoxxMD opened this issue Sep 1, 2022 · 2 comments
Labels
UI CM Web UI

Comments

@FoxxMD
Copy link
Owner

FoxxMD commented Sep 1, 2022

Previously replaced a large swatch of the initial websockets implementation with polling in #91

Currently websockets has become more cumbersome than it is beneficial:

  • Requires a separate implementation to "sync" authentication with regular session when client connects (more code to maintain)
  • Client is not actually using benefits of bi-directional communication -- its only used for server -> client updates
  • Requires more configuration/setup for reverse-proxy which is a barrier to easy deployment
  • Recently, for some reason, even though it is only being used on the status page for receiving opStats updates it is sending a massive amount of data.

It would be a better develop experience to just remove it entirely and replace it with another polling implementation.

@FoxxMD FoxxMD added the UI CM Web UI label Sep 1, 2022
FoxxMD added a commit that referenced this issue Sep 1, 2022
* Refactor/remove websockets functionality for relaying opstats from server with direct polling by client
* Implement delta responses initially introduced in #91 to reduce bandwidth
@OmgImAlexis
Copy link

OmgImAlexis commented Sep 17, 2022

What about server sent events? Would remove the need to poll and you’d be able to handle it just like any other http request?

@FoxxMD
Copy link
Owner Author

FoxxMD commented Sep 19, 2022

SSEs are a possibility! With SSEs I'd still need to keep track of authenticated users that are currently connected which was the primary hassle with websockets.

So far I've found polling from the client has been more than sufficient. I replaced all websocket usage on the dashboard for real-time stats and was able to reduce traffic pretty significantly by tying it into the same idle timeouts log streaming is using.

The only place I haven't been able to entirely eliminate websockets is with reddit oauth on the config editor page -- I still need a way to communicate with the main window after oauth in completed from the popup and redirect occurs. I'll see if SSE might fit the bill for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI CM Web UI
Projects
None yet
Development

No branches or pull requests

2 participants