8000 Sending error object in addition to error message in case of IMS token failures by arugupta1992 · Pull Request #486 · adobecom/unity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 2 commits into from
Jun 19, 2025

Conversation

arugupta1992
Copy link
Collaborator
@arugupta1992 arugupta1992 commented Jun 18, 2025

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:

@arugupta1992 arugupta1992 added bug fix Something isn't working acrobat labels Jun 18, 2025
Copy link
aem-code-sync bot commented Jun 18, 2025

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link
@github-actions github-actions bot left a 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.

await new Promise((res) => setTimeout(res, delay));


🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.

await new Promise((res) => setTimeout(res, 10000 delay));


🚫 [eslint] <no-await-in-loop> reported by reviewdog 🐶
Unexpected await inside a loop.

await new Promise((res) => setTimeout(res, delay));


🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.

await new Promise((res) => setTimeout(res, delay));


🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.

export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') {


🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.

export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') {


🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.

export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') {


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

const urlObj = new URL(url);


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

const params = urlObj.searchParams;


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

if (params.get(paramName) === oldValue) {


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 6 spaces but found 10.

params.set(paramName, newValue);


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

return urlObj.toString();


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

return null;


🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.

|| host.includes('hlx.live')


🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.

|| host.includes('aem.live')


🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_adobe_corpnew'.

data.data._adobe_corpnew = { digitalData: event.detail };


🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_satellite'.

window._satellite?.track('event', data);

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.

export function decorateArea(area = document) {}

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.

await new Promise((resolve) => setTimeout(resolve, RETRY_WAIT));

@@ -89,6 +90,7 @@ async function getImsToken() {
token: null,
error: {
message: `Error getting IMS access token: ${error.message}`,
originalError: JSON.stringify(error),
Copy link
Collaborator

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

Suggested change
originalError: JSON.stringify(error),
[originalError: JSON.stringify(error)](message: `Error getting IMS access token: ${JSON.stringify(error)}`),

Do the same above as well.

Copy link
@github-actions github-actions bot left a 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.

await new Promise((res) => setTimeout(res, delay));


🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.

await new Promise((res) => setTimeout(res, delay));


🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.

export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') {


🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.

export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') {


🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.

export function updateQueryParameter(url, paramName='format', oldValue='webply', newValue='jpeg') {


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

const urlObj = new URL(url);


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

const params = urlObj.searchParams;


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

if (params.get(paramName) === oldValue) {


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 6 spaces but found 10.

params.set(paramName, newValue);


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

return urlObj.toString();


🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 4 spaces but found 6.

return null;


🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.

|| host.includes('hlx.live')


🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.

|| host.includes('aem.live')


🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_adobe_corpnew'.

data.data._adobe_corpnew = { digitalData: event.detail };


🚫 [eslint] <no-underscore-dangle> reported by reviewdog 🐶
Unexpected dangling '_' in '_satellite'.

window._satellite?.track('event', data);

type: 'refresh_error',
originalToken: accessToken,
originalToken: accessToken

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.

Suggested change
originalToken: accessToken
originalToken: accessToken,

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.

const currLocale = getConfig().locale?.prefix.replace('/', '')
return currLocale ? currLocale : 'us';

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.

return currLocale ? currLocale : 'us';

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'.

else throw new Error('Could not fetch SVG');

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.

.catch((e) => { svg.remove(); }),

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.

return await Promise.all(promiseArr);

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.

export async function retryRequestUntilProductRedirect(cfg, requestFunction, delay = 1000) {

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.

const scanResponse = await requestFunction();

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.

if (scanResponse.status === 429 || (scanResponse.status >= 500 && scanResponse.status < 600)) {

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.

await new Promise((res) => setTimeout(res, delay));

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.

await new Promise((res) => setTimeout(res, delay));

Copy link
Collaborator
@rohitsahu rohitsahu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rohitsahu
Copy link
Collaborator

@sigadamvenkata stage sanity will suffice for the changes in this PR. Merging to stage.

@rohitsahu rohitsahu merged commit bb22646 into stage Jun 19, 2025
3 of 5 checks passed
rohitsahu pushed a commit that referenced this pull request Jul 7, 2025
* 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
rohitsahu pushed a commit that referenced this pull request Jul 10, 2025
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acrobat bug fix Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0