json_rpc_2 icon indicating copy to clipboard operation
json_rpc_2 copied to clipboard

Added the ability to pass in a custom Json RPC ID

Open Luzzotica opened this issue 1 year ago • 9 comments

I needed the ability to pass in a custom RPC id.

It was easy to add, and doesn't affect the protocol's API in any way, just added functionality.

Luzzotica avatar Mar 23 '23 02:03 Luzzotica

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Mar 23 '23 02:03 google-cla[bot]

@devoncarew – what our maintenance story on this package?

kevmoo avatar Mar 23 '23 10:03 kevmoo

Can you describe your use case?

This PR would need tests and a CHANGELOG entry, but I'd like to understand the motivation better before we accept it.

natebosch avatar May 10 '23 20:05 natebosch

Without additional information we're not able to resolve this PR. Feel free to add more info or respond to any questions above. Thanks for your contribution!

github-actions[bot] avatar Jun 07 '23 08:06 github-actions[bot]

Gosh dang! I missed your comments guys sorry!

I needed to use a JSON RPC but have complete control of the RPC IDs.

This package, without the changes I made, only allow incrementing IDs.

My JSON RPC package is WalletConnect and it sends JSON RPC requests to a relay that forwards it to subscribers. There are thousands, maybe tens of thousands of JSON RPC requests sent to the relay and if every one used incrementing RPC IDs there would be conflicts. Having complete control over the entropy for the RPC IDs is the only way to resolve this.

Hence my changes.

If you need more details let me know.

Luzzotica avatar Jun 07 '23 16:06 Luzzotica

The use case makes sense. Can you add a test and a CHANGELOG entry?

https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#changelog-entries

natebosch avatar Jun 07 '23 16:06 natebosch

Looks like the CLA also needs attention.

https://github.com/dart-lang/json_rpc_2/pull/92#issuecomment-1480524197

natebosch avatar Jun 07 '23 16:06 natebosch

Just agreed to the CLA.

Luzzotica avatar Jun 07 '23 16:06 Luzzotica

The use case makes sense. Can you add a test and a CHANGELOG entry?

https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#changelog-entries

I think we still need a CHANGELOG entry and a test if this is still something you'd like to see landed.

natebosch avatar Feb 13 '24 23:02 natebosch