Protocol-level connection errors result in CLOSED
status instead of ERROR
#126
Labels
needs triage
Issue/PR needs triage by a project maintainer
Expected Behavior
When a connection is closed due to a protocol-level error (such as rejected SETUP), the connection status should be set to
ERROR
.As per the documentation here:
rsocket-js/packages/rsocket-types/src/ReactiveSocketTypes.js
Lines 147 to 148 in a85a4db
Actual Behavior
Protocol-level connection errors result in the
connectionStatus()
Flowable
emitting a status ofCLOSED
.Steps to Reproduce
Minimal reproduction: https://github.com/duke9509/rsocket-js-error-status-repro
The server just immediately rejects every SETUP frame.
Output from the client:
(I have no idea why
CONNECTED
is seemingly emitted twice, but I'm not too concerned about it and it seemed orthogonal to this issue so I didn't bother to dig into it)Possible Solution
I can think of at least a couple approaches to fixing this. The simplest in my mind is to ammend
DuplexConnection#close
and its implementations to accept an optionalerror
argument indicating that the connection is being closed due to an error and should behave as such.This seems easy enough to implement and I've already tested it locally, so I plan to submit a PR.
Your Environment
netty
, ...): N/Ajavar -version
) or Node version (node --version
)): Node 15.14.0uname -a
): macOS Big Sur 11.2.3The text was updated successfully, but these errors were encountered: