-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tests for handlers cleanly exiting #267
Conversation
router/server.ts
Outdated
@@ -595,6 +598,8 @@ class RiverServer<Services extends AnyServiceSchemaMap> | |||
reqReadable, | |||
resWritable, | |||
}); | |||
|
|||
resWritable.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, why?
} else if (procedure.type === 'rpc' || procedure.type === 'subscription') { | ||
// Though things can work just fine if they eventually follow up with a stream | ||
// control message with a close bit set, it's an unusual client implementation! | ||
this.log?.warn('sent an init without a stream close', loggingMetadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was noise and didnt tell us anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ye
router/server.ts
Outdated
@@ -647,6 +654,7 @@ class RiverServer<Services extends AnyServiceSchemaMap> | |||
} | |||
|
|||
resWritable.write(responsePayload); | |||
resWritable.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra safety
router/server.ts
Outdated
if (!newStream.endedSignal.aborted) { | ||
// if the stream was immediately aborted, don't bother setting it up | ||
this.streams.set(streamId, newStream); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle cases where we exited from the stream before we set here
Why
What changed
Versioning