-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Replace unnecesary calls to SaveChangesAsync by FlushAsync #17084
base: main
Are you sure you want to change the base?
Conversation
@kevinchalet just because we talked about these years ago and you might remember something that I don't. |
I'm not familiar enough with YesSql to know the differences between I guess one risk of making this change is that some exceptions might surface elsewhere, when the session is committed higher in the stack, rather than in the stores themselves? |
Calling |
Functional tests are still passing on this branch. https://github.com/OrchardCMS/OrchardCore/actions/runs/12042510905 Doesn't mean that everything was tested. How awesome would it be if we have functional tests for these operations, including concurrency checks. |
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.
looks good to me
@sebastienros makes sense, thanks the detailed explanation 👍🏻 (but just in case, that might be worth testing a complete authorization code flow using Postman, to ensure nothing regressed). |
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.
Yeah, I think this is fine.
@kevinchalet largely had me calling SaveChangesAsync
to ensure that IdentityResult.Failed
was the result of an actual sql failure during the session, rather than an exception later in the chain, but when running the transaction through the lifetime of the request, it makes more sense to me to flush it, but leave the transaction still open.
See sebastienros/yessql#601