Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

NC-1950: Fixing WebSocket error response #292

Merged
merged 2 commits into from
Nov 21, 2018

Conversation

lucassaldanha
Copy link
Contributor

@lucassaldanha lucassaldanha commented Nov 21, 2018

PR description

When using JSON-RPC over WebSockets, the client was returning a wrong JSON-RPC 2.0 response object. Now it is returning a proper error response.

In some cases (e.g. invalid request json), it is not possible to get the request id to include in the response. In this cases, we will set the 'id' field to null in the response json. This is valid as per the JSON-RPC 2.0 specification.

(https://www.jsonrpc.org/specification#response_object)

This invalid error response on the WebSockets is causing some issues integrating with Alethio node explorer.

Fixed Issue(s)

fixes NC-1950

@lucassaldanha lucassaldanha self-assigned this Nov 21, 2018
Copy link
Contributor

@CjHare CjHare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lucassaldanha lucassaldanha merged commit f89bb81 into PegaSysEng:master Nov 21, 2018
@lucassaldanha lucassaldanha deleted the wserror branch November 21, 2018 23:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants