-
Notifications
You must be signed in to change notification settings - Fork 9
[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
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.
8000Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
fillsign: ['single','page-limit-100'], |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
'split-pdf': ['single', 'max-filesize-1-gb','split-pdf-page-limits','signedInallowedFileTypes'], |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
'split-pdf': ['single', 'max-filesize-1-gb','split-pdf-page-limits','signedInallowedFileTypes'], |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 198 to 199 in ae6d683
'chat-pdf-student': ['hybrid', 'allowed-filetypes-pdf-word-ppt-txt', 'page-limit-600', 'max-numfiles-10', 'max-filesize-100-mb'] | |
}; |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'error_generic' found.
'error_generic': 'verb_upload_error_generic', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_error_loading_verb_limits' found.
'pre_upload_error_loading_verb_limits': 'verb_upload_error_loading_verb_limits', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_error_empty_verb_limits' found.
'pre_upload_error_empty_verb_limits': 'verb_upload_error_empty_verb_limits', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_error_renaming_file' found.
'pre_upload_error_renaming_file': 'verb_upload_error_renaming_file', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_error_fetch_redirect_url' found.
'pre_upload_error_fetch_redirect_url': 'verb_upload_error_fetch_redirect_url', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_validate_files' found.
'validation_error_validate_files': 'verb_upload_error_validate_files', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_unsupported_type' found.
'validation_error_unsupported_type': 'verb_upload_error_unsupported_type', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_empty_file' found.
'validation_error_empty_file': 'verb_upload_error_empty_file', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_too_large' found.
'validation_error_file_too_large': 'verb_upload_error_file_too_large', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_only_accept_one_file' found.
'validation_error_only_accept_one_file': 'verb_upload_error_only_accept_one_file', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_same_type' found.
'validation_error_file_same_type': 'verb_upload_error_file_same_type', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_unsupported_type_multi' found.
'validation_error_unsupported_type_multi': 'verb_upload_error_unsupported_type_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_empty_file_multi' found.
'validation_error_empty_file_multi': 'verb_upload_error_empty_file_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_too_large_multi' found.
'validation_error_file_too_large_multi': 'verb_upload_error_file_too_large_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_multiple_invalid_files' found.
'validation_error_multiple_invalid_files': 'verb_upload_error_multiple_invalid_files', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_max_num_files' found.
'validation_error_max_num_files': 'verb_upload_error_max_num_files', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_same_type_multi' found.
'validation_error_file_same_type_multi': 'verb_upload_error_file_same_type_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_max_page_count' found.
'upload_validation_error_max_page_count': 'verb_upload_error_max_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_min_page_count' found.
'upload_validation_error_min_page_count': 'verb_upload_error_min_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_verify_page_count' found.
'upload_validation_error_verify_page_count': 'verb_upload_error_verify_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_max_page_count_multi' found.
'upload_validation_error_max_page_count_multi': 'verb_upload_error_max_page_count_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_duplicate_asset' found.
'upload_validation_error_duplicate_asset': 'verb_upload_error_duplicate_asset', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_max_quota_exceeded' found.
'upload_error_max_quota_exceeded': 'verb_upload_error_max_quota_exceeded', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_no_storage_provision' found.
'upload_error_no_storage_provision': 'verb_upload_error_no_storage_provision', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_chunk_upload' found.
'upload_error_chunk_upload': 'verb_upload_error_chunk_upload', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_finalize_asset' found.
'upload_error_finalize_asset': 'verb_upload_error_finalize_asset', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_redirect_to_app' found.
'upload_error_redirect_to_app': 'verb_upload_error_redirect_to_app', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_warn_chunk_upload' found.
'upload_warn_chunk_upload': 'verb_upload_warn_chunk_upload', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_warn_renamed_invalid_file_name' found.
'pre_upload_warn_renamed_invalid_file_name': 'verb_warn_renamed_invalid_file_name', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'warn_delete_asset' found.
'warn_delete_asset': 'verb_upload_warn_delete_asset', |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 345 to 346 in ae6d683
getMetadata: `${unityConfig.apiEndPoint}/asset/metadata` | |
}; |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 384 to 385 in ae6d683
desc: errorMetaData.desc || message || undefined | |
}, |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
There should be no space before ','.
const detail = { event: eventName, ...(data && { data }) , sendToSplunk }; |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
fileName = DOS_SPECIAL_NAMES.has(nameWithoutExtension.toUpperCase()) |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
? `---${ext}` |
🚫 [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 426 to 427 in ae6d683
await this.dispatchErrorToast('pre_upload_warn_renamed_invalid_file_name', null, `Renamed ${rawFileName} to ${fileName}`, true) | |
} |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
return multiFileErrorMessage.endsWith('_multi') |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
? multiFileErrorMessage.slice(0, -6) |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
await this.dispatchErrorToast('validation_error_max_num_files', null, `Maximum ${this.limits.maxNumFiles} files allowed`, false, true, { |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
code: 'validation_error_validate_files', |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 466 to 467 in ae6d683
subCode: 'validation_error_max_num_files' | |
}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
return { isValid: false, validFiles}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
return {isValid: true, validFiles}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
return {isValid: true, validFiles}; |
🚫 [eslint] <keyword-spacing> reported by reviewdog 🐶
Expected space(s) after "if".
if(!(cOpts.payload.feedback)) { |
🚫 [eslint] <quotes> reported by reviewdog 🐶
Strings must use singlequote.
if (this.multiFileValidationFailure) cOpts.payload.feedback = "uploaderror"; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.dispatchAnalyticsEvent('redirectUrl', {...filesData, redirectUrl: this.redirectUrl}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.dispatchAnalyticsEvent('redirectUrl', {...filesData, redirectUrl: this.redirectUrl}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 620 to 623 in ae6d683
if (!combinedLimits || Object.keys(combinedLimits).length === 0) await this.dispatchErrorToast('error_generic', 500, 'No verb limits found', false, true, { | |
code: 'pre_upload_error_empty_verb_limits', | |
desc: 'No verb limits found', | |
}); |
🚫 [eslint] <eol-last> reported by reviewdog 🐶
Newline required at end of file but not found.
🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'area' is assigned a value but never used.
unity/unitylibs/scripts/utils.js
Line 29 in ae6d683
export function decorateArea(area = document) {} |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/scripts/utils.js
Lines 110 to 111 in ae6d683
error: e | |
}; |
🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.
unity/unitylibs/scripts/utils.js
Line 131 in ae6d683
await new Promise((resolve) => setTimeout(resolve, RETRY_WAIT)); |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/scripts/utils.js
8000 Lines 165 to 166 in ae6d683
error: result.error | |
}; |
🚫 [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.
unity/unitylibs/scripts/utils.js
Lines 192 to 193 in ae6d683
const currLocale = getConfig().locale?.prefix.replace('/', '') | |
return currLocale ? currLocale : 'us'; |
🚫 [eslint] <no-unneeded-ternary> reported by reviewdog 🐶
Unnecessary use of conditional expression for default assignment.
unity/unitylibs/scripts/utils.js
Line 193 in ae6d683
return currLocale ? currLocale : 'us'; |
🚫 [eslint] <no-else-return> reported by reviewdog 🐶
Unnecessary 'else' after 'return'.
unity/unitylibs/scripts/utils.js
Line 214 in ae6d683
else throw new Error('Could not fetch SVG'); |
🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'e' is defined but never used.
unity/unitylibs/scripts/utils.js
Line 217 in ae6d683
.catch((e) => { svg.remove(); }), |
🚫 [eslint] <no-return-await> reported by reviewdog 🐶
Redundant use of await
on a return value.
unity/unitylibs/scripts/utils.js
Line 269 in ae6d683
return await Promise.all(promiseArr); |
🚫 [eslint] <no-shadow> reported by reviewdog 🐶
'delay' is already declared in the upper scope on line 342 column 17.
unity/unitylibs/scripts/utils.js
Line 313 in ae6d683
export async function retryRequestUntilProductRedirect(cfg, requestFunction, delay = 1000) { |
🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await
inside a loop.
unity/unitylibs/scripts/utils.js
Line 316 in ae6d683
const scanResponse = await requestFunction(); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 101. Maximum allowed is 100.
unity/unitylibs/scripts/utils.js
Line 317 in ae6d683
if (scanResponse.status === 429 || (scanResponse.status >= 500 && scanResponse.status < 600)) { |
🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await
inside a loop.
unity/unitylibs/scripts/utils.js
Line 318 in ae6d683
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 318 in ae6d683
await new Promise((res) => setTimeout(res, delay)); |
🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await
inside a loop.
unity/unitylibs/scripts/utils.js
Line 324 in ae6d683
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 324 in ae6d683
await new Promise((res) => setTimeout(res, delay)); |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
unity/unitylibs/scripts/utils.js
Line 350 in ae6d683
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 350 in ae6d683
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 350 in ae6d683
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 352 in ae6d683
const urlObj = new URL(url); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 353 in ae6d683
const params = urlObj.searchParams; |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 354 in ae6d683
if (params.get(paramName) === oldValue) { |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 6 spaces but found 10.
unity/unitylibs/scripts/utils.js
Line 355 in ae6d683
params.set(paramName, newValue); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 356 in ae6d683
} |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 358 in ae6d683
return urlObj.toString(); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.
unity/unitylibs/scripts/utils.js
Line 360 in ae6d683
return null; |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
unity/unitylibs/scripts/utils.js
Line 389 in ae6d683
|| host.includes('hlx.live') |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
unity/unitylibs/scripts/utils.js
Line 391 in ae6d683
|| host.includes('aem.live') |
🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_adobe_corpnew'.
unity/unitylibs/scripts/utils.js
Line 407 in ae6d683
data.data._adobe_corpnew = { digitalData: event.detail }; |
🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_satellite'.
unity/unitylibs/scripts/utils.js
Line 409 in ae6d683
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.
Could we possibly instead move the flattenObject
function out of the utils file and into a separate file? I understand the initial reasoning for keeping it here, however as this method is only called if the access token is null or expired, I don't believe we should incur a performance hit across all workflows by adding to utils which is used across all of our workflows. We can instead dynamically load it as needed. Please let me know your thoughts.
@arugupta1992 Please include the ticket number in PR title as well. |
…ically when required
@@ -715,7 +715,7 @@ export default class ActionBinder { | |||
const errorDetails = this.tokenError; | |||
await this.dispatchErrorToast('pre_upload_error_fetching_access_token', null, `Could not fetch access token; Error: ${errorDetails.originalError}`, false, true, { | |||
code: 'pre_upload_error_fetching_access_token', | |||
desc: `${errorDetails.message}; Error: ${errorDetails.originalError.message}, Stack : ${errorDetails.originalError.stack}`, | |||
desc: errorDetails |
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.
desc: errorDetails | |
desc: errorDetails, |
|
||
|
||
|
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-multiple-empty-lines> reported by reviewdog 🐶
More than 1 blank line not allowed.
originalError: retryAttempt.error, | ||
originalToken: accessToken, | ||
originalError: flattenObject(retryAttempt.error), | ||
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] <
F438
;comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
originalToken: accessToken | |
originalToken: accessToken, |
export function flattenObject(obj, options = {}) { | ||
const { | ||
separator = '.', | ||
prefix = '', | ||
maxDepth = 10, | ||
includeArrays = true, | ||
preserveNull = false, | ||
excludeTypes = ['function'], | ||
seenObjects = new WeakSet() | ||
} = options; | ||
if (obj === null || obj === undefined) return preserveNull ? { [prefix || 'value']: obj } : {}; | ||
if (typeof obj !== 'object') return { [prefix || 'value']: obj }; | ||
if (seenObjects.has(obj)) return { [prefix || 'circular']: '[Circular Reference]' }; | ||
if (maxDepth <= 0) return { [prefix || 'maxDepth']: '[Max Depth Reached]' }; | ||
seenObjects.add(obj); | ||
const flattened = {}; | ||
try { | ||
if (Array.isArray(obj)) { | ||
if (!includeArrays) flattened[prefix || 'array'] = `[Array(${obj.length})]`; | ||
else { | ||
obj.forEach((item, index) => { | ||
const key = prefix ? `${prefix}${separator}${index}` : `${index}`; | ||
const nested = flattenObject(item, { | ||
...options, | ||
prefix: key, | ||
maxDepth: maxDepth - 1, | ||
seenObjects | ||
}); | ||
Object.assign(flattened, nested); | ||
}); | ||
} | ||
} | ||
else { | ||
Object.keys(obj).forEach(key => { | ||
const value = obj[key]; | ||
const newKey = prefix ? `${prefix}${separator}${key}` : key; | ||
if (excludeTypes.includes(typeof value)) { | ||
flattened[newKey] = `[${typeof value}]`; | ||
return; | ||
} | ||
if (value === null || value === undefined) { | ||
if (preserveNull) flattened[newKey] = value; | ||
return; | ||
} | ||
if (typeof value !== 'object') flattened[newKey] = value; | ||
else { | ||
const nested = flattenObject(value, { | ||
...options, | ||
prefix: newKey, | ||
maxDepth: maxDepth - 1, | ||
seenObjects | ||
}); | ||
Object.assign(flattened, nested); | ||
} | ||
}); | ||
} | ||
} finally { | ||
seenObjects.delete(obj); | ||
} | ||
return flattened; | ||
} |
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] <import/prefer-default-export> reported by reviewdog 🐶
Prefer default export.
includeArrays = true, | ||
preserveNull = false, | ||
excludeTypes = ['function'], | ||
seenObjects = new WeakSet() |
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.
seenObjects = new WeakSet() | |
seenObjects = new WeakSet(), |
Object.assign(flattened, nested); | ||
}); | ||
} | ||
} |
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-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
} | |
} |
} | ||
} | ||
else { | ||
Object.keys(obj).forEach(key => { |
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] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
Object.keys(obj).forEach(key => { | |
Object.keys(obj).forEach((key) => { |
...options, | ||
prefix: newKey, | ||
maxDepth: maxDepth - 1, | ||
seenObjects |
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.
seenObjects | |
seenObjects, |
seenObjects.delete(obj); | ||
} | ||
return flattened; | ||
} |
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-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
} | |
} |
seenObjects.delete(obj); | ||
} | ||
return flattened; | ||
} |
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.
|
||
|
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.
nit: remove extra new lines
* 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
* stage: [MWPW-173999] [MWPW-174144] Add additional headers (#457) [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) # Conflicts: # unitylibs/core/workflow/workflow-acrobat/action-binder.js
…ested error object) and flatten it to be logged in splunk incase of ims token failure (#497) 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.hlx.live/acrobat/online/rotate-pdf?unitylibs=imsEnahncement-2 URL for testing: https://stage--dc--adobecom.hlx.live/acrobat/online/rotate-pdf?unitylibs=imsEnahncement-2
- #457 - #497 - #496 - #495 - #491 - #492 - #493 **Test URLs:** CC - Before: https://main--cc--adobecom.hlx.live/products/photoshop/online?unitylibs=main - After: https://main--cc--adobecom.hlx.live/products/photoshop/online?unitylibs=stage DC - Before: https://main--dc--adobecom.hlx.live/acrobat/online/compress?unitylibs=main - After: https://main--dc--adobecom.hlx.live/acrobat/online/compress?unitylibs=stage
Resolves: MWPW-174041
Test URLs:
Before: https://stage--dc--adobecom.aem.page/acrobat/online/compress-pdf?unitylibs=stage
After: https://stage--dc--adobecom.hlx.live/acrobat/online/rotate-pdf?unitylibs=imsEnahncement-2
URL for testing:
https://stage--dc--adobecom.hlx.live/acrobat/online/rotate-pdf?unitylibs=imsEnahncement-2