Skip to content

Conversation

@pmaytak
Copy link
Contributor

@pmaytak pmaytak commented Mar 19, 2025

Fixes #3181
Adds back methods and adds tests.

@pmaytak pmaytak requested a review from a team as a code owner March 19, 2025 06:28
@pmaytak pmaytak requested a review from Copilot March 19, 2025 06:28
Copy link
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 reintroduces two overloads for methods that determine whether an exception (or exception type) is recoverable, and adds corresponding tests. Key changes include:

  • Adding an overload for IsRecoverableException(Exception exception) that defaults the configuration keys parameter to false.
  • Adding an overload for IsRecoverableExceptionType(Type exceptionType) that defaults the configuration keys parameter to false.
  • Introducing comprehensive tests to validate the behavior of both methods.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/Microsoft.IdentityModel.Tokens.Tests/TokenUtilitiesTests.cs Added tests targeting recoverable exception methods.
src/Microsoft.IdentityModel.Tokens/TokenUtilities.cs Added overloads for IsRecoverableException and IsRecoverableExceptionType with updated XML documentation.
Comments suppressed due to low confidence (1)

src/Microsoft.IdentityModel.Tokens/TokenUtilities.cs:247

  • The XML documentation for the IsRecoverableException overload incorrectly refers to an 'exception type' while the parameter is an Exception instance. Updating the summary to accurately reflect the parameter would improve clarity.
/// Check whether the given exception type is recoverable by LKG.

@github-actions
Copy link

Summary

Summary
Generated on: 3/19/2025 - 6:41:16 AM
Coverage date: 3/19/2025 - 6:31:30 AM - 3/19/2025 - 6:40:49 AM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

@github-actions
Copy link

Summary

Summary
Generated on: 3/19/2025 - 5:02:18 PM
Coverage date: 3/19/2025 - 4:52:31 PM - 3/19/2025 - 5:01:51 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

Copy link
Contributor

@kllysng kllysng left a comment

Choose a reason for hiding this comment

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

Thanks, Peter

Copy link
Contributor

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks @pmaytak

@pmaytak pmaytak merged commit c2bb66d into dev Mar 20, 2025
5 checks passed
@pmaytak pmaytak deleted the pmaytak/api-revert branch March 20, 2025 18:03
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.

[Bug] Internal method, IsRecoverableExceptionType, signature was changed

4 participants