socket-function 0.11.1 → 0.12.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.11.1",
3
+ "version": "0.12.1",
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",
@@ -13,7 +13,7 @@
13
13
  "node-forge": "https://github.com/sliftist/forge#name",
14
14
  "pako": "^2.1.0",
15
15
  "preact": "^10.10.6",
16
- "typenode": "^5.3.10",
16
+ "typenode": "^5.3.11",
17
17
  "ws": "^8.8.0"
18
18
  },
19
19
  "optionalDependencies": {
@@ -195,7 +195,7 @@ export async function createCallFactory(
195
195
  let arg = originalArgs[0] as any;
196
196
  fncHack = `.${arg.DomainName}.${arg.ModuleId}.${arg.FunctionId}`;
197
197
  }
198
- console.log(`SIZE\t${(formatNumberSuffixed(resultSize) + "B").padEnd(4, " ")}\t${call.classGuid}.${call.functionName}${fncHack} at ${Date.now()}`);
198
+ console.log(`SIZE\t${(formatNumberSuffixed(resultSize) + "B").padEnd(4, " ")}\tREMOTE CALL\t${call.classGuid}.${call.functionName}${fncHack} at ${Date.now()}`);
199
199
  }
200
200
  }
201
201
  await send(data);
@@ -418,7 +418,7 @@ export async function createCallFactory(
418
418
  }
419
419
  if (SocketFunction.logMessages) {
420
420
  let call = callbackObj.call;
421
- console.log(`SIZE\t${(formatNumberSuffixed(resultSize) + "B").padEnd(4, " ")}\t${call.classGuid}.${call.functionName} at ${Date.now()}`);
421
+ console.log(`SIZE\t${(formatNumberSuffixed(resultSize) + "B").padEnd(4, " ")}\tRETURN\t${call.classGuid}.${call.functionName} at ${Date.now()}`);
422
422
  }
423
423
  if (call.isResultCompressed) {
424
424
  call.result = await decompressObj(call.result as Buffer);
@@ -431,7 +431,7 @@ export async function createCallFactory(
431
431
  call.isArgsCompressed = false;
432
432
  }
433
433
  if (SocketFunction.logMessages) {
434
- console.log(`SIZE\t${(formatNumberSuffixed(resultSize) + "B").padEnd(4, " ")}\t${call.classGuid}.${call.functionName} at ${Date.now()}`);
434
+ console.log(`SIZE\t${(formatNumberSuffixed(resultSize) + "B").padEnd(4, " ")}\tEVALUATE\t${call.classGuid}.${call.functionName} at ${Date.now()}`);
435
435
  }
436
436
  if (time > SocketFunction.WIRE_WARN_TIME) {
437
437
  console.log(red(`Slow parse, took ${time}ms to parse ${resultSize} bytes, for call to ${call.classGuid}.${call.functionName}`));
package/src/misc.ts CHANGED
@@ -218,7 +218,7 @@ export function throttleFunction<Args extends any[]>(
218
218
  if (result instanceof Promise) {
219
219
  result.finally(() => {
220
220
  afterCall(Date.now() + delay);
221
- });
221
+ }).catch(e => console.error(e));
222
222
  } else {
223
223
  afterCall(Date.now() + delay);
224
224
  }