Skip to content

fix ui_not_allowed naming while preserving ux_not_allowed compatibility#8608

Open
lalimasharda wants to merge 9 commits into
devfrom
fix-ui-not-allowed-typo
Open

fix ui_not_allowed naming while preserving ux_not_allowed compatibility#8608
lalimasharda wants to merge 9 commits into
devfrom
fix-ui-not-allowed-typo

Conversation

@lalimasharda
Copy link
Copy Markdown
Contributor

@lalimasharda lalimasharda commented May 27, 2026

This pull request standardizes the terminology used for UI/UX restriction error codes by making uiNotAllowed/UI_NOT_ALLOWED the primary naming, while preserving backward compatibility for existing uxNotAllowed/ux_not_allowed consumers.

Error code and constant updates:

  • Set uiNotAllowed ("ui_not_allowed") as the primary interaction-required error code in InteractionRequiredAuthErrorCodes.ts.
  • Reintroduced uxNotAllowed ("ux_not_allowed") as a deprecated alias that points users to uiNotAllowed.
  • Kept native UI_NOT_ALLOWED as primary while also supporting legacy UX_NOT_ALLOWED status values for compatibility.

Error handling and messaging updates:

  • Updated interaction-required matching in InteractionRequiredAuthError.ts to recognize both uiNotAllowed and deprecated uxNotAllowed.
  • Updated sub-error matching to accept both "ui_not_allowed" and "ux_not_allowed" for compatibility with existing server/broker responses.
  • Updated createNativeAuthError in msal-browser to handle both UI_NOT_ALLOWED and UX_NOT_ALLOWED native statuses.

Documentation updates:

  • Updated docs/errors.md to document ui_not_allowed as the primary value and ux_not_allowed as a deprecated alias.
  • Updated lib/msal-common/apiReview/msal-common.api.md to reflect the public API surface including the deprecated alias.

Test updates:

  • Updated InteractionRequiredAuthError.spec.ts coverage to validate both uiNotAllowed and deprecated uxNotAllowed mappings.
  • Updated NativeAuthError.spec.ts coverage to validate both UI_NOT_ALLOWED and legacy UX_NOT_ALLOWED native status mappings.

@lalimasharda lalimasharda requested a review from a team as a code owner May 27, 2026 01:35
Copilot AI review requested due to automatic review settings May 27, 2026 01:35
@lalimasharda lalimasharda changed the title fixed ui_not_allowed type in NativeAuthError types fixed ui_not_allowed typo in NativeAuthError sub_error types May 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 aims to standardize “UI not allowed” terminology by renaming uxNotAllowed/UX_NOT_ALLOWED to uiNotAllowed/UI_NOT_ALLOWED across msal-common and msal-browser, updating both runtime mappings and unit tests.

Changes:

  • Renamed interaction-required error code uxNotAlloweduiNotAllowed and updated interaction-required matching lists (InteractionRequiredAuthError*).
  • Renamed native broker status constant UX_NOT_ALLOWEDUI_NOT_ALLOWED and updated NativeAuthError mapping.
  • Regenerated msal-common.api.md and updated affected unit tests.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/msal-common/src/error/InteractionRequiredAuthErrorCodes.ts Renames the exported interaction-required error code constant.
lib/msal-common/src/error/InteractionRequiredAuthError.ts Updates interaction-required code/suberror allowlists to the new name/value.
lib/msal-common/test/error/InteractionRequiredAuthError.spec.ts Updates tests to use the renamed interaction-required code.
lib/msal-common/apiReview/msal-common.api.md Updates API review output to reflect the renamed public export.
lib/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts Renames the WAM/native status constant.
lib/msal-browser/src/error/NativeAuthError.ts Updates status-to-error mapping to the renamed status/code.
lib/msal-browser/test/error/NativeAuthError.spec.ts Updates tests to assert the renamed status/code mapping.
Comments suppressed due to low confidence (1)

lib/msal-browser/src/broker/nativeBroker/NativeStatusCodes.ts:15

  • NativeStatusCodes.UI_NOT_ALLOWED is defined as the literal string "UI_NOT_ALLOWED". However, repo changelogs and docs refer to the WAM/native status/suberror as UX_NOT_ALLOWED/ux_not_allowed. If the native broker still emits "UX_NOT_ALLOWED", this rename will prevent createNativeAuthError from recognizing the condition. Consider keeping the existing "UX_NOT_ALLOWED" literal and adding UI_NOT_ALLOWED as an alias, or handling both values.
export const PERSISTENT_ERROR = "PERSISTENT_ERROR";
export const DISABLED = "DISABLED";
export const ACCOUNT_UNAVAILABLE = "ACCOUNT_UNAVAILABLE";
export const UI_NOT_ALLOWED = "UI_NOT_ALLOWED";

Comment thread lib/msal-common/src/error/InteractionRequiredAuthErrorCodes.ts
Comment thread lib/msal-common/src/error/InteractionRequiredAuthError.ts
Comment thread lib/msal-browser/src/error/NativeAuthError.ts
Comment thread lib/msal-common/test/error/InteractionRequiredAuthError.spec.ts
Comment thread lib/msal-browser/test/error/NativeAuthError.spec.ts
@lalimasharda
Copy link
Copy Markdown
Contributor Author

@copilot please run beachball:change and commit the change files

Copilot AI changed the title fixed ui_not_allowed typo in NativeAuthError sub_error types fix ui_not_allowed naming while preserving ux_not_allowed compatibility May 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

@copilot please run beachball:change and commit the change files

Done. I ran npm run beachball:change and committed the generated change files in 846370f.

@lalimasharda
Copy link
Copy Markdown
Contributor Author

@copilot can you take another pass at reviewing the PR?

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

@copilot can you take another pass at reviewing the PR?

I took another pass through the PR. The UI/UX compatibility updates and test coverage look good, and targeted tests for InteractionRequiredAuthError and NativeAuthError pass locally. I don’t see any additional changes needed at this point.

@lalimasharda
Copy link
Copy Markdown
Contributor Author

@copilot can you run apiExtractor and fix the msal-common api.md?

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

@copilot can you run apiExtractor and fix the msal-common api.md?

Done in 83ad455. I ran apiExtractor for lib/msal-common, updated lib/msal-common/apiReview/msal-common.api.md, and fixed the deprecated uxNotAllowed TSDoc links so extraction now passes cleanly.

Comment on lines +26 to +30
/**
* Deprecated alias for {@link InteractionRequiredAuthErrorCodes.uiNotAllowed}. UI/UX is not allowed (e.g., blocked by policy), requiring alternate interaction.
* @deprecated Please use {@link InteractionRequiredAuthErrorCodes.uiNotAllowed}.
* @public
*/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These shouldn't be publicly accessible. If it's not used we can simply remove it instead of deprecating it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing now would be a breaking change because it a part of the public api.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No it's not. We only export error codes we actually throw. If we're no longer throwing this code we can remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants