Skip to content
Closed
Changes from 1 commit
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/common/src/client/sync/stream/AbstractRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export abstract class AbstractRemote {
clearTimeout(keepAliveTimeout);
keepAliveTimeout = setTimeout(() => {
this.logger.error(`No data received on WebSocket in ${SOCKET_TIMEOUT_MS}ms, closing connection.`);
stream.close();
stream?.close();
}, SOCKET_TIMEOUT_MS);
};
resetTimeout();
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I understand the issue correctly, I think the stream variable has not been assigned by the time the first timeout happens - perhaps due to the initial connection taking longer than the timeout.

I think we might be able to avoid this by removing the resetTimeout call here which starts the timeout process before connector.connect() has been called.

Copy link
Author

Choose a reason for hiding this comment

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

That would make sense. I've updated the PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the work here! After digging deeper into this issue, I realized that we should handle a timeout during the initial connect call better. I've implemented that timeout functionality here #671
If that PR gets merged we can close this one. Thanks again for for bringing this issue to our attention and for all your efforts.

Expand Down