@rh-support/troubleshoot 2.7.50 → 2.7.52

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.
@@ -430,7 +430,7 @@ needsAnalyzing = false, isSessionId = false, slowUploadConfig = {}, apolloClient
430
430
  percentUploaded: 100,
431
431
  onAbort: undefined,
432
432
  });
433
- yield pollAttachmentUploadStatus(apolloClient, caseSalesforceId, attachmentId, idToUploadTo);
433
+ yield pollAttachmentUploadStatus(apolloClient, caseSalesforceId, attachmentId);
434
434
  }
435
435
  }
436
436
  attachmentId && updateAttachmentIdForFile(dispatch, attachmentId, index);
@@ -1 +1 @@
1
- {"version":3,"file":"useInProgressAttachmentPoll.d.ts","sourceRoot":"","sources":["../../../src/hooks/useInProgressAttachmentPoll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACH,iBAAiB,EAKpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAwB,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAO1G,UAAU,iCAAiC;IACvC,YAAY,EAAE,iBAAiB,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,mBAAmB,EAAE,mBAAmB,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACjE,mBAAmB,EAAE,8BAA8B,CAAC;CACvD;AAED,wBAAgB,2BAA2B,CAAC,EACxC,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,GACtB,EAAE,iCAAiC,GAAG,IAAI,CAyE1C"}
1
+ {"version":3,"file":"useInProgressAttachmentPoll.d.ts","sourceRoot":"","sources":["../../../src/hooks/useInProgressAttachmentPoll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACH,iBAAiB,EAKpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAwB,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAK1G,UAAU,iCAAiC;IACvC,YAAY,EAAE,iBAAiB,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,mBAAmB,EAAE,mBAAmB,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACjE,mBAAmB,EAAE,8BAA8B,CAAC;CACvD;AAED,wBAAgB,2BAA2B,CAAC,EACxC,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,GACtB,EAAE,iCAAiC,GAAG,IAAI,CAiE1C"}
@@ -12,26 +12,19 @@ import { useEffect, useRef } from 'react';
12
12
  import { CaseDetailsConstants } from '../reducers/CaseDetailsPageReducer';
13
13
  /** How often to re-check In Progress attachments (ms) - 5s */
14
14
  const POLL_INTERVAL_MS = 5000;
15
- /** Stop polling after this many cycles to avoid infinite loops - 36 cycles = 3 minutes */
16
- const MAX_POLL_CYCLES = 36;
17
15
  export function useInProgressAttachmentPoll({ apolloClient, caseNumber, caseSalesforceId, caseAttachmentHydra, dispatchCaseDetails, }) {
18
16
  var _a;
19
- const pollCountRef = useRef(0);
20
17
  const isFetchingRef = useRef(false);
21
18
  const attachments = ((_a = caseAttachmentHydra.data) !== null && _a !== void 0 ? _a : []);
22
19
  const hasInProgress = attachments.some((a) => a && isAttachmentUploadInProgress(a));
23
20
  useEffect(() => {
24
21
  if (!hasInProgress || !caseSalesforceId || caseAttachmentHydra.isFetching) {
25
- pollCountRef.current = 0;
26
22
  return;
27
23
  }
28
24
  const pollOnce = () => __awaiter(this, void 0, void 0, function* () {
29
25
  if (isFetchingRef.current)
30
26
  return;
31
- if (pollCountRef.current >= MAX_POLL_CYCLES)
32
- return;
33
27
  isFetchingRef.current = true;
34
- pollCountRef.current += 1;
35
28
  try {
36
29
  const freshAttachments = yield fetchCaseAttachmentsViaGraphQL(apolloClient, caseNumber, caseSalesforceId);
37
30
  const stillInProgress = freshAttachments.some(isAttachmentUploadInProgress);
@@ -56,10 +49,6 @@ export function useInProgressAttachmentPoll({ apolloClient, caseNumber, caseSale
56
49
  if (stopped || stillInProgress === false)
57
50
  return;
58
51
  intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
59
- if (pollCountRef.current >= MAX_POLL_CYCLES) {
60
- clearInterval(intervalId);
61
- return;
62
- }
63
52
  const still = yield pollOnce();
64
53
  if (still === false) {
65
54
  clearInterval(intervalId);
@@ -50,7 +50,7 @@ export function useS3Upload(caseNumber, apolloClient, caseSalesforceId) {
50
50
  resolvedCaseSalesforceId = caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.id;
51
51
  }
52
52
  if (apolloClient && resolvedCaseSalesforceId) {
53
- yield pollAttachmentUploadStatus(apolloClient, resolvedCaseSalesforceId, attachmentId, caseNumber);
53
+ yield pollAttachmentUploadStatus(apolloClient, resolvedCaseSalesforceId, attachmentId);
54
54
  }
55
55
  return attachmentId;
56
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.7.50",
3
+ "version": "2.7.52",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -42,7 +42,7 @@
42
42
  "react-virtualized": "^9.22.5"
43
43
  },
44
44
  "dependencies": {
45
- "@cee-eng/hydrajs": "^4.18.116",
45
+ "@cee-eng/hydrajs": "^4.18.120 ",
46
46
  "@cee-eng/ui-toolkit": "1.1.9",
47
47
  "@ifd-ui/ask-redhat-core": "^0.0.61",
48
48
  "@patternfly/patternfly": "6.2.1",
@@ -52,11 +52,11 @@
52
52
  "@progress/kendo-licensing": "1.3.5",
53
53
  "@progress/kendo-react-pdf": "^5.16.0",
54
54
  "@redux-devtools/extension": "^3.3.0",
55
- "@rh-support/components": "2.6.43",
56
- "@rh-support/react-context": "2.6.45",
55
+ "@rh-support/components": "2.6.45",
56
+ "@rh-support/react-context": "2.6.47",
57
57
  "@rh-support/types": "2.0.31",
58
- "@rh-support/user-permissions": "2.6.40",
59
- "@rh-support/utils": "2.6.39",
58
+ "@rh-support/user-permissions": "2.6.42",
59
+ "@rh-support/utils": "2.6.41",
60
60
  "@types/react-redux": "^7.1.33",
61
61
  "@types/redux": "^3.6.0",
62
62
  "date-fns": "3.6.0",
@@ -129,5 +129,5 @@
129
129
  "defaults and supports es6-module",
130
130
  "maintained node versions"
131
131
  ],
132
- "gitHead": "cf3cb1889fcffd7f8d17727a1930863baad0aa43"
132
+ "gitHead": "45704746d332e15fd54506984909bc91452ef4a9"
133
133
  }