Skip to content
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

Fix logger undefined #5355

Merged
merged 27 commits into from
Dec 14, 2022
Merged

Fix logger undefined #5355

merged 27 commits into from
Dec 14, 2022

Conversation

bmahall
Copy link
Contributor

@bmahall bmahall commented Nov 2, 2022

Fixes #4412

When loggerOptions is explicitly set to undefined/void 0, it leads to "Cannot read options of undefined" error which breaks the application. This PR makes loggerOptions optional to address this.

Tests included for msal-browser and msal-node.
Covers: msal-browser,msal-angular,msal-node samples.

@github-actions github-actions bot added msal-browser Related to msal-browser package msal-common Related to msal-common package msal-node Related to msal-node package msal@1.x Related to msal@1.x (implicit flow) node-token-validation labels Nov 2, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 2, 2022

Codecov Report

Merging #5355 (1253d42) into dev (44197d9) will decrease coverage by 0.00%.
The diff coverage is 84.61%.

Flag Coverage Δ *Carryforward flag
msal-angular 96.50% <ø> (ø)
msal-browser 86.50% <100.00%> (+0.01%) ⬆️
msal-common 85.29% <71.42%> (-0.05%) ⬇️
msal-core 82.84% <ø> (ø) Carriedforward from 44197d9
msal-node 83.37% <100.00%> (+0.03%) ⬆️
msal-node-extensions 76.03% <ø> (ø)
msal-react 94.68% <ø> (ø)
node-token-validation 88.88% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
lib/msal-node/src/client/ClientApplication.ts 73.63% <ø> (ø)
lib/msal-common/src/logger/Logger.ts 91.42% <71.42%> (-2.61%) ⬇️
lib/msal-browser/src/config/Configuration.ts 95.65% <100.00%> (+0.41%) ⬆️
...rc/interaction_client/StandardInteractionClient.ts 97.02% <100.00%> (+0.02%) ⬆️
lib/msal-node/src/config/Configuration.ts 100.00% <100.00%> (ø)

@github-actions github-actions bot removed the msal@1.x Related to msal@1.x (implicit flow) label Nov 2, 2022
change/msal-6c65b933-30cb-4cc9-b6ae-4b890ca4b848.json Outdated Show resolved Hide resolved
lib/msal-common/src/logger/Logger.ts Outdated Show resolved Hide resolved
lib/msal-common/src/logger/Logger.ts Outdated Show resolved Hide resolved
lib/msal-common/src/logger/Logger.ts Outdated Show resolved Hide resolved
lib/msal-common/test/logger/Logger.spec.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@tnorling tnorling left a comment

Choose a reason for hiding this comment

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

Looks good, can you add some tests?

@ghost
Copy link

ghost commented Nov 28, 2022

Reminder: The next release is scheduled for next week and this PR appears to be stale :(

If changes have been requested please address feedback.
If this PR is still a work in progress please mark as draft.

@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Nov 28, 2022
@ghost ghost removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label Dec 1, 2022
@bmahall bmahall merged commit 8b18e2a into dev Dec 14, 2022
@bmahall bmahall deleted the fixLoggerUndefined branch December 14, 2022 19:49
@ghost
Copy link

ghost commented Jan 9, 2023

🎉@azure/msal-common@v9.0.2 has been released which incorporates this pull request.:tada:

We recommend upgrading to the latest version of @azure/msal-browser or @azure/msal-node to take advantage of this change.

Handy links:

@ghost
Copy link

ghost commented Jan 10, 2023

🎉@azure/msal-node@v1.14.6 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Jan 10, 2023

🎉@azure/msal-browser@v2.32.2 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msal-browser Related to msal-browser package msal-common Related to msal-common package msal-node Related to msal-node package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Cannot read properties of undefined (reading 'loggerCallback')
5 participants