Skip to content
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

AK1001: CodeFix accidentally removes other PipeTo arguments in addition to Sender #32

Closed
Aaronontheweb opened this issue Jan 3, 2024 · 0 comments · Fixed by #34
Closed

Comments

@Aaronontheweb
Copy link
Member

Version Information
Version of Akka.NET? v0.1.1
Which Akka.NET Modules? Akka.Analyzer

Describe the bug

We have the following original code:

https://github.com/akkadotnet/akka.net/blob/2633f914122b42aae87de807cee1561ab9749f27/src/core/Akka.Docs.Tests/Streams/StreamRefsDocTests.cs#L56-L61

It should be refactored to:

 // create a source
var sender = Sender;
StreamLogs(request.StreamId)
    // materialize it using stream refs
    .RunWith(StreamRefs.SourceRef<string>(), Context.System.Materializer())
    // and send to sender
    .PipeTo(sender, success: sourceRef => new LogsOffer(request.StreamId, sourceRef));

But is INSTEAD refactored to

 // create a source
var sender = Sender;
StreamLogs(request.StreamId)
    // materialize it using stream refs
    .RunWith(StreamRefs.SourceRef<string>(), Context.System.Materializer())
    // and send to sender
    .PipeTo(sender));

The success: sourceRef => new LogsOffer(request.StreamId, sourceRef) gets deleted by accident here.

Expected behavior

Only the replyTo argument on the PipeTo call should be changed, not 100% of the arguments.

Actual behavior

The success: sourceRef => new LogsOffer(request.StreamId, sourceRef) gets deleted by accident here.

Additional context

If there are any other optional parameters for PipeTo, we should add cases to cover those inside the code fix test suite for it as well. Do this exhaustively so we ensure that there are no problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant