Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 28, 2025

The automation test failures after PR #2685 were caused by an incomplete copyWithZone method in MSIDRequestParameters that was missing several critical properties, including the newly introduced bypassRedirectURIValidation property.

Problem

When MSAL created request parameters and they were copied during request processing, properties were being lost because the copyWithZone method was not copying all declared properties. This caused the bypassRedirectURIValidation feature to malfunction, as the property would revert to its default value (NO) instead of preserving the configured value.

Root Cause

The copyWithZone method in MSIDRequestParameters.m was missing assignments for 10 properties:

  • bypassRedirectURIValidation - Critical for the new bypass redirect validation feature
  • ignoreScopeValidation - Could cause unexpected scope validation failures
  • forceRefresh - Could prevent forced token refresh behavior
  • allowAnyExtraURLQueryParameters - Could block required query parameters
  • allowUsingLocalCachedRtWhenSsoExtFailed - Could affect SSO fallback behavior
  • clientBrokerKeyCapabilityNotSupported - Could affect broker key capabilities
  • webPageUri - Could lose web page URI information
  • nonce - Could lose security nonce
  • authScheme - Could lose authentication scheme information
  • ssoContext - Could lose SSO context information

Solution

Updated the copyWithZone method in MSAL/IdentityCore/IdentityCore/src/parameters/MSIDRequestParameters.m to include all missing property assignments, ensuring complete object copying.

Added comprehensive unit test testCopyWithZone_shouldCopyAllProperties_includingBypassRedirectURIValidation to verify that all critical properties are properly preserved during copy operations and prevent regression.

Impact

This fix ensures that when request parameters are copied during authentication flows, all properties are properly preserved, resolving the automation test failures and ensuring the bypassRedirectURIValidation feature works as intended.

Fixes #2690.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Contributor Author

Copilot AI commented Aug 28, 2025

@juan-arias 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@@ -407,6 +407,7 @@
609AF9332256BD0C00E2978D /* MSALAccountsProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 609AF9322256BD0C00E2978D /* MSALAccountsProviderTests.m */; };

Choose a reason for hiding this comment

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

This pull request does not update CHANGELOG.md.

Please consider if this change would be noticeable to a partner or user and either update CHANGELOG.md or resolve this conversation.

@Copilot Copilot AI changed the title [WIP] Automation tests failure Fix MSIDRequestParameters copyWithZone method missing critical properties causing automation test failures Aug 28, 2025
@Copilot Copilot AI requested a review from juan-arias August 28, 2025 03:36
Copilot finished work on behalf of juan-arias August 28, 2025 03:36
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.

Automation tests failure
2 participants