-
Notifications
You must be signed in to change notification settings - Fork 9
Sending error object in addition to error message in case of IMS token failures #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
eslint
🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await
inside a loop.
unity/unitylibs/scripts/utils.js
Line 267 in 4e2055f
await new Promise((res) => setTimeout(res, delay)); |
🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.
unity/unitylibs/scripts/utils.js
Line 267 in 4e2055f
await new Promise((res) => setTimeout(res, 10000 delay)); |
🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await
inside a loop.
unity/unitylibs/scripts/utils.js
Line 273 in 4e2055f
await new Promise((res) => setTimeout(res, delay)); |
🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.
unity/unitylibs/scripts/utils.js
Line 273 in 4e2055f
await new Promise((res) => setTimeout(res, delay)); |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
unity/unitylibs/scripts/utils.js
Line 299 in 4e2055f
export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') { |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
unity/unitylibs/scripts/utils.js
Line 299 in 4e2055f
export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') { |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
unity/unitylibs/scripts/utils.js
Line 299 in 4e2055f
export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') { |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 301 in 4e2055f
const urlObj = new URL(url); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 302 in 4e2055f
const params = urlObj.searchParams; |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 303 in 4e2055f
if (params.get(paramName) === oldValue) { |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 6 spaces but found 10.
unity/unitylibs/scripts/utils.js
Line 304 in 4e2055f
params.set(paramName, newValue); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 305 in 4e2055f
} |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 307 in 4e2055f
return urlObj.toString(); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 309 in 4e2055f
return null; |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
unity/unitylibs/scripts/utils.js
Line 338 in 4e2055f
|| host.includes('hlx.live') |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
unity/unitylibs/scripts/utils.js
Line 340 in 4e2055f
|| host.includes('aem.live') |
🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_adobe_corpnew'.
unity/unitylibs/scripts/utils.js
Line 356 in 4e2055f
data.data._adobe_corpnew = { digitalData: event.detail }; |
🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_satellite'.
unity/unitylibs/scripts/utils.js
Line 358 in 4e2055f
window._satellite?.track('event', data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'area' is assigned a value but never used.
unity/unitylibs/scripts/utils.js
Line 29 in 4e2055f
export function decorateArea(area = document) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.
unity/unitylibs/scripts/utils.js
Line 72 in 4e2055f
await new Promise((resolve) => setTimeout(resolve, RETRY_WAIT)); |
unitylibs/scripts/utils.js
Outdated
@@ -89,6 +90,7 @@ async function getImsToken() { | |||
token: null, | |||
error: { | |||
message: `Error getting IMS access token: ${error.message}`, | |||
originalError: JSON.stringify(error), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use the message field only
originalError: JSON.stringify(error), | |
[originalError: JSON.stringify(error)](message: `Error getting IMS access token: ${JSON.stringify(error)}`), |
Do the same above as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
eslint
🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await
inside a loop.
unity/unitylibs/scripts/utils.js
Line 271 in 42513a8
await new Promise((res) => setTimeout(res, delay)); |
🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.
unity/unitylibs/scripts/utils.js
Line 271 in 42513a8
await new Promise((res) => setTimeout(res, delay)); |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
unity/unitylibs/scripts/utils.js
Line 297 in 42513a8
export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') { |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
unity/unitylibs/scripts/utils.js
Line 297 in 42513a8
export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') { |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
unity/unitylibs/scripts/utils.js
Line 297 in 42513a8
export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') { |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 299 in 42513a8
const urlObj = new URL(url); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 300 in 42513a8
const params = urlObj.searchParams; |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 301 in 42513a8
if (params.get(paramName) === oldValue) { |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 6 spaces but found 10.
unity/unitylibs/scripts/utils.js
Line 302 in 42513a8
params.set(paramName, newValue); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 303 in 42513a8
} |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 305 in 42513a8
return urlObj.toString(); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 307 in 42513a8
return null; |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
unity/unitylibs/scripts/utils.js
Line 336 in 42513a8
|| host.includes('hlx.live') |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
unity/unitylibs/scripts/utils.js
Line 338 in 42513a8
|| host.includes('aem.live') |
🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_adobe_corpnew'.
unity/unitylibs/scripts/utils.js
Line 354 in 42513a8
data.data._adobe_corpnew = { digitalData: event.detail }; |
🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_satellite'.
unity/unitylibs/scripts/utils.js
Line 356 in 42513a8
window._satellite?.track('event', data); |
type: 'refresh_error', | ||
originalToken: accessToken, | ||
originalToken: accessToken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
originalToken: accessToken | |
originalToken: accessToken, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.
unity/unitylibs/scripts/utils.js
Lines 139 to 140 in 42513a8
const currLocale = getConfig().locale?.prefix.replace('/', '') | |
return currLocale ? currLocale : 'us'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-unneeded-ternary> reported by reviewdog 🐶
Unnecessary use of conditional expression for default assignment.
unity/unitylibs/scripts/utils.js
Line 140 in 42513a8
return currLocale ? currLocale : 'us'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-else-return> reported by reviewdog 🐶
Unnecessary 'else' after 'return'.
unity/unitylibs/scripts/utils.js
Line 161 in 42513a8
else throw new Error('Could not fetch SVG'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'e' is defined but never used.
unity/unitylibs/scripts/utils.js
Line 164 in 42513a8
.catch((e) => { svg.remove(); }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-return-await> reported by reviewdog 🐶
Redundant use of await
on a return value.
unity/unitylibs/scripts/utils.js
Line 216 in 42513a8
return await Promise.all(promiseArr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-shadow> reported by reviewdog 🐶
'delay' is already declared in the upper scope on line 289 column 17.
unity/unitylibs/scripts/utils.js
Line 260 in 42513a8
export async function retryRequestUntilProductRedirect(cfg, requestFunction, delay = 1000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await
inside a loop.
unity/unitylibs/scripts/utils.js
Line 263 in 42513a8
const scanResponse = await requestFunction(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 101. Maximum allowed is 100.
unity/unitylibs/scripts/utils.js
Line 264 in 42513a8
if (scanResponse.status === 429 || (scanResponse.status >= 500 && scanResponse.status < 600)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await
inside a loop.
unity/unitylibs/scripts/utils.js
Line 265 in 42513a8
await new Promise((res) => setTimeout(res, delay)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.
unity/unitylibs/scripts/utils.js
Line 265 in 42513a8
await new Promise((res) => setTimeout(res, delay)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@sigadamvenkata stage sanity will suffice for the changes in this PR. Merging to stage. |
…n failures (#486) Resolves: [MWPW-174041](https://jira.corp.adobe.com/browse/MWPW-174041) **Test URLs:** - Before: https://stage--dc--adobecom.aem.page/acrobat/online/compress-pdf?unitylibs=stage - After: https://stage--dc--adobecom.aem.page/acrobat/online/compress-pdf?unitylibs=imsEnhancements
PRs: - #484 - #476 - #486 - #488 - #487 **Test URLs:** DC - Before: https://stage--dc--adobecom.aem.page/acrobat/online/compress-pdf?unitylibs=main - After: https://stage--dc--adobecom.aem.page/acrobat/online/compress-pdf?unitylibs=stage CC - Before: https://stage--cc--adobecom.aem.page/products/photoshop/remove-background?unitylibs=main - After: https://stage--cc--adobecom.aem.page/products/photoshop/remove-background?unitylibs=stage
* stage: IMS error logging improvement - Phase 1 (#493) [MWPW-173462] Loading screen: Text should not be marked as a heading (#487) Allow empty query (#488) Sending error object in addition to error message in case of IMS token failures (#486) [MWPW-174632] Getting 'unable to process the request' error toast for 'Empty File + Max File Size' upload for 2b/2c (#476) [MWPW-171797] Introduce timeout to all fetch calls being made (#484) Fix for workflow getting stuck at transition screen if asset api fails (#481) Fix CSS issues found during launch (#482) [MWPW-174834] Added pdf file support in ocr. Was a miss from the last PR. (#483) [MWPW-174834] Fallback to file extension if MIME type is absent for determining file type (#480) [MWPW-174783] Fix error message issue on Japanese page (#478) [MWPW-172186] Phase 2 of accessibility fix for transition screen (#460) # Conflicts: # unitylibs/core/workflow/workflow-acrobat/action-binder.js # unitylibs/utils/FileUtils.js
* stage: [MWPW-174041] : Generic method to parse the error object (including nested error object) and flatten it to be logged in splunk incase of ims token failure (#497) [MWPW-175541] Improve Unit Tests (#496) [MWPW-175937] Unity linting fixes (#495) [NALA]UI Automation tests scripts for batch 2A verbs (#491) [MWPW-174048] Remove close icon from prompt suggestion dropdown (#492) IMS error logging improvement - Phase 1 (#493) [MWPW-173462] Loading screen: Text should not be marked as a heading (#487) Allow empty query (#488) Sending error object in addition to error message in case of IMS token failures (#486) [MWPW-174632] Getting 'unable to process the request' error toast for 'Empty File + Max File Size' upload for 2b/2c (#476) [MWPW-171797] Introduce timeout to all fetch calls being made (#484) # Conflicts: # unitylibs/core/workflow/workflow-acrobat/action-binder.js # unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Resolves: MWPW-174041
Adding entire error object in our logging for ims token failure, instead of the error message. Error message was always coming undefined.
Test URLs: