MetaMask/eth-json-rpc-middleware

`retryOnEmpty` incorrectly checking the response from the child request

mcmire opened this issue · 0 comments

In 3eb4f1a#diff-9043aff30876c1d6c43ddee1949bf50ced00c070e176a175ce46e0b418a9d61cR77, the retry-on-empty middleware was converted to TypeScript. In the original (JavaScript) version of this middleware, it seems that we were checking whether the result in the response was empty. Now we are checking whether the whole response is empty. This seems like a bug, and it makes this middleware effectively useless in the extension (because thanks to the Infura middleware as exported from createInfuraMiddleware in eth-json-rpc-infura, the result of provider.sendAsync will always be a valid JSON-RPC response object and never null or undefined).