Repository navigation
Fix unit of work middleware edge cases and document its options - #26299
Merged
Merged
Conversation
- Skip SignalR hub requests in `AbpUnitOfWorkMiddleware` - Don't begin a completed or disposed reservation in `TryBeginReserved`
1 task done
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## rel-10.7 #26299 +/- ##
============================================
+ Coverage 49.89% 49.91% +0.02%
============================================
Files 3857 3857
Lines 135140 135153 +13
Branches 10243 10244 +1
============================================
+ Hits 67426 67464 +38
+ Misses 65701 65659 -42
- Partials 2013 2030 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hikalkan
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolve #26259
UseUnitOfWork()completes the request unit of work after the rest of the pipeline. If the action returned a body, the response has already started by then. So when the commit or a unit of work event handler fails, the client still gets200 OKwith the success body, and the data is not saved.The startup templates will use
UseAbpExceptionHandling()instead. Then the MVC action and page filters complete the unit of work before the result is written, and a failure returns an error. The unit of work document now explains this, the middleware options and their limits.Also fixed:
IQueryabledirectly needs its own unit of work.TryBeginReservedno longer reuses a reservation that was already completed or disposed, like one a background task sees after its request ends. Such work now starts a new unit of work.