fix: error when current context is undefined#870
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #870 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 57 57
Lines 3251 3251
Branches 630 630
=========================================
Hits 3251 3251 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
arjuncooliitr
approved these changes
May 29, 2025
dthampy
approved these changes
May 29, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an error encountered when the current IMS context is undefined by adding a proper truthy check before overriding the CLI context in the getAccessToken flow.
- Updated test to simulate an undefined current context.
- Modified auth-helper.js to conditionally use the current context only if it is truthy.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/commands/lib/auth-helper.test.js | Adjusted test description and simulated a scenario with an undefined current context. |
| src/lib/auth-helper.js | Introduced a truthy check to ensure the current context is defined before overriding the default. |
purplecabbage
approved these changes
May 29, 2025
purplecabbage
pushed a commit
that referenced
this pull request
Nov 10, 2025
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.
The error is:
Description
When the current ims context is not set, you can't get an access token. A truthy check was missing.
How Has This Been Tested?
aio plugins link .to this PR branchaio config del imsaio app init test-projectTypes of changes
Checklist: