-
Notifications
You must be signed in to change notification settings - Fork 2.7k
V5 pipelines #7889
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
base: msal-v5
Are you sure you want to change the base?
V5 pipelines #7889
Conversation
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.
Pull Request Overview
This PR refactors error handling, telemetry, and cache interface code to centralize default messages, standardize constant usage, and enhance telemetry correlation.
- Replaced inline error message maps with a shared getDefaultErrorMessage helper.
- Updated many modules to import from a unified Constants module and swapped to the new PerformanceEvents exports.
- Changed ICacheManager remove methods to require a correlationId and return void, and updated implementations accordingly.
Reviewed Changes
Copilot reviewed 205 out of 428 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/error/ClientAuthError.ts | Removed hardcoded ClientAuthErrorMessages and simplified constructor to use default messages. |
| src/error/AuthError.ts & CacheError.ts | Introduced getDefaultErrorMessage, removed inline message maps, and adjusted super() calls. |
| src/cache/interface/ICacheManager.ts & CacheManager.ts | Changed removeAccount/removeAccessToken/etc. signatures to take a correlationId and return void. |
Comments suppressed due to low confidence (4)
lib/msal-common/src/error/ClientAuthErrorCodes.ts:21
- The literal uses mixed casing (
appMetadata) in the snake_case string. For consistency with other codes, consider"multiple_matching_app_metadata".
export const multipleMatchingAppMetadata = "multiple_matching_appMetadata";
lib/msal-common/src/error/ClientAuthError.ts:19
- By passing only
additionalMessagehere, the original descriptive message forerrorCodeis lost whenever additionalMessage is provided. Consider fetching the default description and concatenating, e.g.:const baseMsg = getDefaultErrorMessage(errorCode); super(errorCode, additionalMessage ?${baseMsg}: ${additionalMessage}: baseMsg);
super(errorCode, additionalMessage);
lib/msal-common/src/error/CacheError.ts:26
- The thrown error message no longer includes the
errorCodeprefix, breaking consistency with other errors. Consider usingsuper(${errorCode}: ${message});so the code remains part of the message.
super(message);
lib/msal-common/src/cache/interface/ICacheManager.ts:200
- The signature change to require a
correlationIdbreaks existing callers ofremoveAllAccounts()with no arguments. Either update all call sites to pass the correlationId or consider overloading/retaining a zero-arg version for backward compatibility.
removeAllAccounts(correlationId: string): void;
|
Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft. |
No description provided.