socket-function 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/batching.ts +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
package/src/batching.ts CHANGED
@@ -149,7 +149,12 @@ export function batchFunction<Arg, Result = void>(
149
149
  let curPrevPromise = prevPromise;
150
150
  let args: Arg[] = [arg];
151
151
  let promise = Promise.resolve().then(async () => {
152
- await curPrevPromise;
152
+ // Ignore the error. New callers don't care about errors in previous calls,
153
+ // as they are unrelated to the current call, and just break valid calls
154
+ // due to invalid calls.
155
+ try {
156
+ await curPrevPromise;
157
+ } catch { }
153
158
  await delay(curDelay, "immediateShortDelays");
154
159
  // Reset batching, as we once we start the function we can't accept args. `prevPromise` will block
155
160
  // the next batch from starting before we finish.