Skip to content

allow disabling of version check #47

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dr-bonez
Copy link

@dr-bonez dr-bonez commented Sep 17, 2018

there are some json rpc servers out there that do not return a version but are otherwise json rpc 2.0 compliant. this feature allows them to be used.


This change is Reviewable

@faern
Copy link
Member

faern commented Sep 19, 2018

This feels like the wrong approach to me. Having even more implementations start breaking the spec will unlikely make the ecosystem better. On the other hand, we are at the same time trying to add subscriptions in at the moment, which is also not part of the real spec so..

Anyway, I still think this is the wrong approach. If this is done with a feature it forces all clients used in the same Rust binary to either use or not use the version check. This feels like something one would want to configure on each individual client.

@alexander-irbis
Copy link

Having even more implementations start breaking the spec will unlikely make the ecosystem better

Adding exceptions for the compatibility with a legacy is better for the ecosystem than creating a duplicating projects with similar functionality.

@pronebird
Copy link

I was reading a document describing differences between v1 and v2 and it basically states the following:

"jsonrpc" field added: added a version-field to the Request (and also to the Response) to resolve compatibility issues with JSON-RPC 1.0

It feels wrong to go against the spec that introduced the version field in the first place to disambiguate between the old and new protocol.

@alexander-irbis
Copy link

It feels wrong to go against the spec

I have real world services, which go against the spec. It is impossible not to go against the spec, as I depend on these services. And it just works if I comment out the check of version.

Should I make a fork of jsonrpc-client to just disable this check and to make all work? It looks somewhat pointless.

Frankly said, there are many exceptions in buggy services written by people "with curved hands". I can handle these exceptions of protocols in my code. But the version check is the ultimate feature, which prevents all communication with such services for no other reason than "to follow spec", which anyway is not followed in my cases.

@pronebird
Copy link

pronebird commented Nov 28, 2018

While seemingly easy to fix on this end, have you considered raising that issue with the services that go against the protocol?

If you are paying for the service, they must be able to assist you and fix the missing field.

I may be wrong but it’s either omission on the service’s side or they built something that resembles jsonrpc but is actually not.

@faern
Copy link
Member

faern commented Nov 30, 2018

This crate is currently in a slightly shaky state. We want to upgrade to a newer hyper backend and a few other things. So very little time has been put into this crate. Basically I'm waiting for the newer futures (0.3) and async-await support before I want to invest too much time here.

But that being said. If we allow skipping the version check on replies I still don't think it should be a cargo feature that affects the entire crate. It should probably be a configure option on each client. This PR also has a merge conflict at the moment. Making it not possible to merge right now.

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

Successfully merging this pull request may close these issues.

4 participants