fixing crash in attemptTokenRefresh when adobeIMS.refreshToken() returns null - #876
Open
arugupta1992 wants to merge 1 commit into
Open
fixing crash in attemptTokenRefresh when adobeIMS.refreshToken() returns null#876arugupta1992 wants to merge 1 commit into
arugupta1992 wants to merge 1 commit into
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
Commits
|
vipu0303
reviewed
Aug 24, 2026
| const { tokenInfo } = window.adobeIMS ? await window.adobeIMS.refreshToken() : {}; | ||
| return tokenInfo; | ||
| const res = window.adobeIMS ? await window.adobeIMS.refreshToken() : null; | ||
| return res?.tokenInfo ?? { token: null, isGuestToken: true }; |
Collaborator
There was a problem hiding this comment.
Why isGuestToken: true in this case?
Collaborator
Author
There was a problem hiding this comment.
user with no valid token is treated as guest user rather than erroring out. Followed the same convention here.
Collaborator
There was a problem hiding this comment.
I guess this is not the invalid case, this is the case where adobeIMS has not been loaded yet. Do we want to retry in this case?
Collaborator
Author
There was a problem hiding this comment.
We are already retrying once in the parent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splunk log:
{"event":{"name":"error_fetching_access_token","category":"acrobat","subcategory":"compress-pdf"},"content":{},"source":{"user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36","lang":"en","app_name":"unity","url":"https://www.adobe.com/acrobat/online/compress-pdf.html"},"user":{"locale":"en","isAuthenticated":"false","type":["frictionless_new_user"]},"error":{"type":-54,"desc":{"message":"Error getting IMS access token: {\"stack\":\"TypeError: Cannot read properties of undefined (reading 'error')\n at attemptTokenRefresh (https://www.adobe.com/unitylibs/scripts/utils.js:64:22)\n at async getImsToken (https://www.adobe.com/unitylibs/scripts/utils.js:81:28)\n at async isGuestUser (https://www.adobe.com/unitylibs/scripts/utils.js:115:18)\n at async ActionBinder.isSignedOut (https://www.adobe.com/unitylibs/core/workflow/workflow-acrobat/action-binder.js:208:20)\n at async ActionBinder.initialize (https://www.adobe.com/unitylibs/core/workflow/workflow-acrobat/action-binder.js:203:5)\n at async ActionBinder.acrobatActionMaps (https://www.adobe.com/unitylibs/core/workflow/workflow-acrobat/action-binder.js:797:28)\n at async HTMLInputElement.<anonymous> (https://www.adobe.com/unitylibs/core/workflow/workflow-acrobat/action-binder.js:897:13)\",\"message\":\"Cannot read properties of undefined (reading 'error')\"}","type":"token_error"}}}Root Cause:
When adobeIMS.refreshToken() returns null, (!refreshResult?.error) crashes throwing TypeError
Test URLs:
Before: https://main--da-dc--adobecom.aem.live/acrobat/online/sign-pdf?unitylibs=stage
After: https://main--da-dc--adobecom.aem.live/acrobat/online/sign-pdf?unitylibs=fixtokenlog