-
Notifications
You must be signed in to change notification settings - Fork 4k
Add missing awaits on CachingClientStore and CachingResourceStore #4794
Conversation
Aren't those the same, tho? And adding the |
On hard load we are getting this exception
Checking out the code, we figure it out that the FindClientByIdAsync on the CachingClientStore is not being awaited and it is the only place on the entire project that is not being awaited and it is where the exception is being raised. |
Do you have any more insight into this? The fix you propose fixes the issue in postgres? |
Also, the change you propose -- doesn't that always trigger loading from the DB? Whereas the point of the Func is to defer the DB lookup unless it's needed. |
Yes, this change solves the issue in Postgres, I haven't tested any other RDBMS but I think they should have similar behavior.
I would like to share a screen recording or at least the script that I have on Postman, but I think that this cannot be possible at least on Github. If you want I can share you that through email or something like that. Thanks! |
Ok I just tested it and it doesn't seem to have any negative impact. I think we have other places like this doing caching in the code, so perhaps you can check for others an update this PR? I just checked, it looks like |
a56fcc6
to
66d08c9
Compare
Done! DeviceAuthorizationResponseGeneratorTests.cs
public void ProcessAsync_when_valiationresult_null_exect_exception()
{
Func<Task> act = () => generator.ProcessAsync(null, TestBaseUrl);
act.Should().Throw<ArgumentNullException>();
...
}
AuthorizeInteractionResponseGeneratorTests_Consent.cs
[Fact]
public void ProcessConsentAsync_NullRequest_Throws()
{
Func<Task> act = () => _subject.ProcessConsentAsync(null, new ConsentResponse());
.
.
}
IResourceStoreExtensionsTests.cs
[Fact]
public void GetAllEnabledResourcesAsync_on_duplicate_identity_scopes_should_fail()
new IdentityResource { Name = "A" } }
};
Func<Task> a = () => store.GetAllEnabledResourcesAsync();
....
}
TokenRequestValidation_General_Invalid.cs
{
..
Func<Task> act = () => validator.ValidateRequestAsync(null, null);
act.Should().Throw<ArgumentNullException>();
parameters.Add(OidcConstants.TokenRequest.RedirectUri, "https://server/cb");
Func<Task> act = () => validator.ValidateRequestAsync(parameters, null);
..
}
I haven't changed it on the PR because I did not take the time to see how the tests were implemented, but if you wanted I can do the same on those classes |
Thanks |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What issue does this PR address?
Add missing awaits on CachingClientStore and CachingResourceStore
Does this PR introduce a breaking change?
no
Please check if the PR fulfills these requirements
Other information: