-
Notifications
You must be signed in to change notification settings - Fork 777
Add ResetExceptionDispatchState operator and document exception reuse limitations #2237
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
Conversation
…ed path detection in build works on agent
The Windows 2025 agents don't have the 10.0.19041 SDK we had previously been relying on installed but they do have 22621 Also fix build issue that seems to have started with .NET SDK 10 in which the Reverse extension method for Span<char> takes precedence over the LINQ operator.
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.
Pull Request Overview
This PR introduces a new CaptureExceptionDispatchState operator and comprehensive documentation to address exception reuse limitations in Rx.NET, specifically the issue where exception stack traces accumulate when the same exception instance is rethrown multiple times.
- Adds the
CaptureExceptionDispatchStateoperator to reset exception dispatch state by performing a throw/catch cycle - Documents the exception reuse problem and provides clear guidelines for developers
- Updates build configuration to use newer Windows SDK versions and build images
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| azure-pipelines.rx.yml | Updates build to use windows-2025 image and removes outdated TargetPlatformSdkPath override |
| Rx.NET/tools/HomoIcon/app.config | Adds .NET Framework 4.8 configuration file |
| Rx.NET/tools/HomoIcon/HomoIcon.csproj | Upgrades project to .NET Framework 4.8 and MSBuild 12.0 |
| Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/ThrowTest.cs | Adds System.Threading.Tasks using directive and removes trailing whitespace |
| Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/MinTest.cs | Fixes LINQ compilation issues by adding AsEnumerable() calls |
| Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/MaxTest.cs | Fixes LINQ compilation issues by adding AsEnumerable() calls |
| Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/Observable/CaptureExceptionDispatchStateTest.cs | Adds comprehensive tests for the new operator |
| Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api/ApiApprovalTests.Core.verified.cs | Updates API approval tests to include the new operator |
| Rx.NET/Source/src/System.Reactive/System.Reactive.csproj | Updates Windows SDK reference to version 10.0.26100.0 |
| Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Single.cs | Implements the core CaptureExceptionDispatchState operator logic |
| Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs | Adds queryable support and fixes documentation comments |
| Rx.NET/Source/src/System.Reactive/Linq/Observable/CaptureExceptionDispatchState.cs | Implements the operator's core functionality with detailed comments |
| Rx.NET/Source/src/System.Reactive/Linq/Observable.Single.cs | Adds public API extension method with documentation |
| Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.cs | Adds interface definition for the new operator |
| Rx.NET/Source/src/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases.csproj | Updates Windows SDK reference to version 10.0.26100.0 |
| Rx.NET/Documentation/adr/0004-onerror-to-throw.md | Comprehensive documentation of exception reuse rules and limitations |
| Rx.NET/Documentation/adr/0003-uap-targets.md | Updates documentation to reflect new Windows SDK version |
| Rx.NET/Documentation/ReleaseHistory/Rx.v6.md | Documents the new operator in release notes |
Comments suppressed due to low confidence (3)
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs:1
- The documentation changes appear to be inconsistent. The first two methods now describe 'enumerable sequence' but the third describes 'observable sequence'. These should be consistent - verify which is correct for each overload.
/*
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs:1
- The documentation changes appear to be inconsistent. The first two methods now describe 'enumerable sequence' but the third describes 'observable sequence'. These should be consistent - verify which is correct for each overload.
/*
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs:1
- The documentation changes appear to be inconsistent. The first two methods now describe 'enumerable sequence' but the third describes 'observable sequence'. These should be consistent - verify which is correct for each overload.
/*
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Issue #2187 illustrates a problem caused by a non-obvious feature of how Rx promotes
OnErrornotifications to real exceptions in mechanisms such asawait.This PR provides two mitgations:
CaptureExceptionDispatchStateoperator that can provide a straightforward way to avoid the problem