-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Bug: Response<T>.Value is a StackOverflow #40140
Conversation
c556422
to
85e8210
Compare
API change check APIView has identified API level changes in this PR and created following API reviews. |
@@ -9,6 +9,6 @@ public partial class SharedTokenCacheCredentialBrokerOptions : Azure.Identity.Sh | |||
{ | |||
public SharedTokenCacheCredentialBrokerOptions() { } | |||
public SharedTokenCacheCredentialBrokerOptions(Azure.Identity.TokenCachePersistenceOptions tokenCacheOptions) { } | |||
public bool? IsMsaPassthroughEnabled { get { throw null; } set { } } | |||
public bool? IsLegacyMsaPassthroughEnabled { get { throw null; } set { } } |
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.
Curious how this is related to this change?
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.
@annelo-msft no idea, but running eng\scripts\Export-API.ps1
updated this. Another PR got merged without updating generated code?
@Porges, would it be possible to share sample code that causes the stack overflow? |
The test that was added exhibits it (but the test code would need to be modified to hit the bug with the previous version by removing the It’s not possible to hit this using the classes which are in the (currently) published SDKs since only subclasses of |
I see. Thank you, that is helpful context! Can you help us understand what your scenario is for creating a subtype of |
I don't have a current need to. This is just something I noticed in the codebase while I was implementing something else (#40136). |
That makes sense. Thank you for reporting the issue! I expect that we will be unable to take this change, since changing a member on a type from If you need help finding a workaround for this issue, please let us know. |
@@ -23,7 +24,7 @@ public abstract class Response<T> : NullableResponse<T> | |||
public override bool HasValue => true; | |||
|
|||
/// <inheritdoc /> | |||
public override T Value => Value; | |||
public abstract override T Value { get; } |
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.
It looks like we may also be able to address this by replacing this line with
public abstract override T Value { get; } | |
public override T Value => base.Value!; |
If you would be open to making that change instead, it would not be an API-breaking change, and I think we would be happy to accept the PR. Thank you for finding and addressing this issue!
Hi @Porges. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Hi @Porges. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing |
Noticed this while doing #40136.
Since the changes made in #35560 (this line),
Response<T>
has been a stack overflow as it references itself:This PR fixes this by making the
Value
property re-abstract. This breaks ApiCompat so there is a new baseline.