AK1001: CodeFix accidentally removes other `PipeTo` arguments in addition to `Sender`
Aaronontheweb opened this issue · comments
Version Information
Version of Akka.NET? v0.1.1
Which Akka.NET Modules? Akka.Analyzer
Describe the bug
We have the following original code:
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.