CardanoSolutions / ogmios

❇️ A WebSocket JSON/RPC bridge for Cardano
https://ogmios.dev
Mozilla Public License 2.0
304 stars 90 forks source link

client/TypeScript: Fault response ignored #89

Closed rhyslbw closed 3 years ago

rhyslbw commented 3 years ago

What Git revision are you using?

a7bab073220caad8b98351515e3d68f5eb605383

What operating system are you using, and which version?

Describe what the problem is?

As reported in https://github.com/input-output-hk/cardano-graphql/issues/545

> await submitTx('abc')
# hangs

What should be the expected behavior?

A failure response

rhyslbw commented 3 years ago

There are two issues:

  1. The server is not reflecting the request mirror value in a Fault response, which is used by the client to match handlers to requests. Line 30 discards the response https://github.com/CardanoSolutions/ogmios/blob/320c97aef8a823e6295412b16a8a3b29bea15dfe/clients/TypeScript/packages/client/src/StateQuery/Query.ts#L28-L37

  2. The Fault response will fall-through to the 'UnexpectedResponseError`, so that should be improved. https://github.com/CardanoSolutions/ogmios/blob/320c97aef8a823e6295412b16a8a3b29bea15dfe/clients/TypeScript/packages/client/src/TxSubmission/submitTx.ts#L156

KtorZ commented 3 years ago

Note: as per b94a8b2daba8fac55534083a3de8a96337d11339, the server now correctly returns the matching mirror / reflection on faults for invalid requests.

KtorZ commented 3 years ago

Fixed in #116