We have a connection to a pusher websocket. We are sending ping message every 40 seconds.
Library being used: https://pub.dev/packages/web_socket_channel
We are logging into console when a disconnection happens.
It takes account on the onDone event here
_subscription = _channel!.stream.listen(
(e) => _handlePusherEvent(e, id),
onDone: () => _onDone(message: 'onDone'), // Erratic clean disconnection here
onError: (e) => _onWebsocketError(e),
);
void _onDone({required String message}) {
print(message);
}
The behavior is erratic, sometimes it is done after 7 hours, sometimes it only takes minutes. We are logging ping and pong messages. The ping message log precedes the onDone event, so it is not being closed due to no ping message being sent.
Is this some issue on pusher side?
Thank you