Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Fix notification response.id check #18

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/createStreamMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function createStreamMiddleware() {
) {
let err;
try {
const isNotification = !res.id;
const isNotification = !('id' in res);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this true if id is null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isNotification will be false if res.id === null.

if (isNotification) {
processNotification((res as unknown) as JsonRpcNotification<unknown>);
} else {
Expand Down