Skip to content
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 packages/stream-management/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function streamManagement({
} catch {}
}

entity.on("disconnect", () => {
entity.on("close", () => {
Copy link
Member

Choose a reason for hiding this comment

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

disconnect looks correct logicially to me here.

Please explain why this makes more sense than changing the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the stream has closed no more stanzas can be sent. If the timeout fires after close but before disconnect, it will try to send and that is what caused the problem. Now we correctly stop the timers at close so they cannot fire on a closed stream.

Copy link
Member

Choose a reason for hiding this comment

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

While investigating I realized there are 2 separate problems

First one is write after end

stream management shouldn't throw when attemtping to send stanzas if the stream or socket is closed

Image

Fixed by #1099

I'll get back to the second one later.

Copy link
Contributor Author

@singpolyma singpolyma Nov 12, 2025

Choose a reason for hiding this comment

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

yes this is the one fixed by this PR. I see from the current CI results there is another one

I'm a bit confused by this second one. It seems to be triggered by data coming in when there is no parser? But I'm not sure how that's possible. Maybe a race condition creating the parser after connect?

clearTimeout(timeoutTimeout);
clearTimeout(requestAckTimeout);
clearTimeout(requestAckDebounce);
Expand Down
Loading