Skip to content

Conversation

@Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Mar 20, 2025

Changes

Supersedes #7537 using @tomachristian's research from that PR

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

Copy link
Member Author

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detailed my changes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed a ton of TBD spam from here

}

private static readonly Result<TOut> NotYetThere = Result.Failure<TOut>(new Exception());
private static readonly Exception NotYetThereException = new Exception();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create the Exception itself as a static readonly

private readonly Decider _decider;

private IBuffer<Holder<TOut>>? _buffer;
private IBuffer<Holder<TOut>> _buffer = null!; // gets initialized in PreStart
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried but the downstream _buffer calls still complained about nullability anyway 🤷

if (_buffer!.IsEmpty)
PullIfNeeded();
else if (_buffer.Peek()!.Element == NotYetThere) // Shebang is fine, we checked that the buffer is not empty
else if (_buffer.Peek()!.Element.Exception == NotYetThereException) // Shebang is fine, we checked that the buffer is not empty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix - check the value of the Exceptions by reference. Can't get a false positive that way.

Copy link
Contributor

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Arkatufus Arkatufus enabled auto-merge (squash) March 20, 2025 13:12
@Aaronontheweb Aaronontheweb disabled auto-merge March 20, 2025 13:35
@Aaronontheweb Aaronontheweb merged commit 485c17f into akkadotnet:dev Mar 20, 2025
12 checks passed
@Aaronontheweb Aaronontheweb deleted the fix-SelectAsync branch March 20, 2025 13:35
This was referenced Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants