From 9f8bd77c9ecd3caed33bfebbca7886550b92c441 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 28 Dec 2022 08:01:39 +0000 Subject: [PATCH] only send push notification if call stream not cancelled --- .../main/java/bisq/daemon/grpc/GrpcNotificationsService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/src/main/java/bisq/daemon/grpc/GrpcNotificationsService.java b/daemon/src/main/java/bisq/daemon/grpc/GrpcNotificationsService.java index 4021c62ec5..5953fd76eb 100644 --- a/daemon/src/main/java/bisq/daemon/grpc/GrpcNotificationsService.java +++ b/daemon/src/main/java/bisq/daemon/grpc/GrpcNotificationsService.java @@ -10,6 +10,7 @@ import bisq.proto.grpc.SendNotificationReply; import bisq.proto.grpc.SendNotificationRequest; import io.grpc.Context; import io.grpc.ServerInterceptor; +import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.StreamObserver; import javax.inject.Inject; @@ -80,7 +81,9 @@ class GrpcNotificationsService extends NotificationsImplBase { @Override public void onMessage(@NonNull NotificationMessage message) { - responseObserver.onNext(message); + if (!((ServerCallStreamObserver) responseObserver).isCancelled()) { + responseObserver.onNext(message); + } } }