Socket
Socket
Sign inDemoInstall

json-rpc-middleware-stream

Package Overview
Dependencies
Maintainers
8
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-rpc-middleware-stream - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

7

CHANGELOG.md

@@ -9,2 +9,6 @@ # Changelog

## [4.1.0]
### Changed
- Added retry limit of 3 to requests ([#30](https://github.com/MetaMask/json-rpc-middleware-stream/pull/30))
## [4.0.0] - 2022-10-03

@@ -22,4 +26,5 @@ ### Changed

[Unreleased]: https://github.com/MetaMask/json-rpc-middleware-stream/compare/v4.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/json-rpc-middleware-stream/compare/v4.1.0...HEAD
[4.1.0]: https://github.com/MetaMask/json-rpc-middleware-stream/compare/v4.0.0...v4.1.0
[4.0.0]: https://github.com/MetaMask/json-rpc-middleware-stream/compare/v3.0.0...v4.0.0
[3.0.0]: https://github.com/MetaMask/json-rpc-middleware-stream/releases/tag/v3.0.0

@@ -97,4 +97,12 @@ "use strict";

function retryStuckRequests() {
Object.values(idMap).forEach(({ req }) => {
// TODO: limiting retries could be implemented here
Object.values(idMap).forEach(({ req, retryCount = 0 }) => {
// Avoid retrying requests without an id - they cannot have matching responses so retry logic doesn't apply
// Check for retry count below ensure that a request is not retried more than 3 times
if (!req.id) {
return;
}
if (retryCount >= 3) {
throw new Error(`StreamMiddleware - Retry limit exceeded for request id "${req.id}"`);
}
idMap[req.id].retryCount = retryCount + 1;
sendToStream(req);

@@ -101,0 +109,0 @@ });

2

package.json
{
"name": "json-rpc-middleware-stream",
"version": "4.0.0",
"version": "4.1.0",
"description": "A small toolset for streaming JSON-RPC data and matching requests and responses.",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc