only send push notification if call stream not cancelled
This commit is contained in:
parent
c5f6aeb4cc
commit
9f8bd77c9e
@ -10,6 +10,7 @@ import bisq.proto.grpc.SendNotificationReply;
|
|||||||
import bisq.proto.grpc.SendNotificationRequest;
|
import bisq.proto.grpc.SendNotificationRequest;
|
||||||
import io.grpc.Context;
|
import io.grpc.Context;
|
||||||
import io.grpc.ServerInterceptor;
|
import io.grpc.ServerInterceptor;
|
||||||
|
import io.grpc.stub.ServerCallStreamObserver;
|
||||||
import io.grpc.stub.StreamObserver;
|
import io.grpc.stub.StreamObserver;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@ -80,7 +81,9 @@ class GrpcNotificationsService extends NotificationsImplBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(@NonNull NotificationMessage message) {
|
public void onMessage(@NonNull NotificationMessage message) {
|
||||||
responseObserver.onNext(message);
|
if (!((ServerCallStreamObserver<NotificationMessage>) responseObserver).isCancelled()) {
|
||||||
|
responseObserver.onNext(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user