Skip to content

Commit ce77ad1

Browse files
authored
Source errors terminate subscription within WebSockets stream (#755)
1 parent c0839c1 commit ce77ad1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Transports.Subscriptions.Abstractions/Subscription.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ public void OnError(Exception error)
7272
// pass along the error as an execution result instance
7373
OnNext(new ExecutionResult { Errors = new ExecutionErrors { executionError } });
7474

75-
// Optionally we can disconnect the client by calling OnComplete() here
75+
// Disconnect the client as no additional notification should be received from the source
7676
//
7777
// https://docs.microsoft.com/en-us/dotnet/standard/events/observer-design-pattern-best-practices
7878
// > Once the provider calls the OnError or IObserver<T>.OnCompleted method, there should be
7979
// > no further notifications, and the provider can unsubscribe its observers.
80+
OnCompleted();
8081
}
8182

8283
public void OnNext(ExecutionResult value)

0 commit comments

Comments
 (0)