Skip to content

Loading…

Notifications #6

Closed
dcharbonnier opened this Issue · 6 comments

2 participants

@dcharbonnier
Collaborator

http://www.jsonrpc.org/specification#notification

A Notification is a Request object without an "id" member. A Request object that is a Notification signifies the Client's lack of interest in the corresponding Response object, and as such no Response object needs to be returned to the client. The Server MUST NOT reply to a Notification, including those that are within a batch request.

Notifications are not confirmable by definition, since they do not have a Response object to be returned. As such, the Client would not be aware of any errors (like e.g. "Invalid params","Internal error").

@pocesar
Owner

it already has support for notifications, or is there an use case where it's not behaving as expected?

@dcharbonnier
Collaborator

No, it's not.
https://github.com/dcharbonnier/node-jsonrpc2/tree/feature/notifications

  12 passing (49ms)
  1 failing

  1) json-rpc2 Notification request:
     Error: expected '{"jsonrpc":"2.0","error":{"code":-32600,"message":"Invalid Request"},"id":null}' to equal ''
@pocesar
Owner

Hmm I really thought it was working (by the way, the current code coverage is AWFUL, less than 35% I guess, need to improve it a lot).

https://github.com/pocesar/node-jsonrpc2/blob/master/src/connection.js#L99

@pocesar
Owner

Since it's an HTTP, it should return HTTP code 200? what would the body be? an empty {} or an empty string? The headers should be changed to deal with an empty body.

@pocesar
Owner

Take a look at the notification branch

@dcharbonnier
Collaborator

I think 200 and I'm sure an empty body. They don't say anything about transport error, but in case of error we MUST NOT send this information.

@pocesar pocesar closed this in 7e2089d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.