ws-process 0.3.38 → 0.3.39

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/index.js +16 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable import/no-unresolved */
2
2
  // ws-process.js
3
3
  import axios from 'axios';
4
+ import * as Sentry from '@sentry/react';
4
5
  import {
5
6
  defined, clone, makeid, tryit,
6
7
  } from '@bsgp/lib-core';
@@ -734,9 +735,24 @@ function asyncSend(msg) {
734
735
 
735
736
  const frameSize = Math.floor(1024 * 32 * 0.9);
736
737
  const refinedMSG = cutStringByLength(wsMSG, frameSize);
738
+
737
739
  if (refinedMSG.length === 1) {
738
740
  local.wsProcess.wSocket.send(wsMSG);
739
741
  } else {
742
+ try {
743
+ const transaction = Sentry.startInactiveSpan({
744
+ name: 'Split Request Payload',
745
+ op: 'onSplitReqPayload',
746
+ data: {
747
+ payload: jsonMSG,
748
+ },
749
+ });
750
+ transaction.finish();
751
+ // Finishing the transaction will send it to Sentry
752
+ } catch (ex) {
753
+ console.log('sentry ex:', ex);
754
+ }
755
+
740
756
  const srcIndicator = getRandomID();
741
757
  const payloadArr = createSplitPayload(refinedMSG, srcIndicator, jsonMSG);
742
758
  payloadArr.forEach((eachMSG) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws-process",
3
- "version": "0.3.38",
3
+ "version": "0.3.39",
4
4
  "description": "Process Management for Web Socket Client",
5
5
  "main": "index.js",
6
6
  "scripts": {