Skip to content

Handling of websocket diconnects / reconnects #39

@Phsacar

Description

@Phsacar

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions