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

Handling of websocket diconnects / reconnects #39

Open
Phsacar opened this issue Nov 4, 2024 · 0 comments
Open

Handling of websocket diconnects / reconnects #39

Phsacar opened this issue Nov 4, 2024 · 0 comments

Comments

@Phsacar
Copy link

Phsacar commented Nov 4, 2024

Hi!
When I restart my python websocket server ( so the websocket connection drops ), the websocket successfully reconnects, but throws an "Invalid JSON" error in the dashboard. ( see: ).

This leads to the websocket unsubscribing from the streaming data in the frontend and my dashboard stops receiving any further data until i reload the page ( pressing refresh in grafana does not help)

What i have done so far:
I had a look at the packets with wireshark and noticed that there are no invalid JSON packets

My current workaround: As a quick fix, i modified the line "throw new Error(Invalid JSON: ${v}. Error: ${e})" to return JSON.parse{}
That solved the problem for me. Now my websocket reconnects properly when the server restarts.

Thanks!

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

No branches or pull requests

1 participant