Skip to content
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

frontend: fix stream function for websocket conn #1688

Closed
wants to merge 1 commit into from
Closed

Conversation

knrt10
Copy link
Contributor

@knrt10 knrt10 commented Feb 1, 2024

When called stream function was calling connect function synchronously and returning cancel and getSocket which were always null. This converts the function to a async function and returns a promise which resolves to the desired values for both getSocket and cancel function.

When called stream function was calling connect function synchronously
and returning cancel and getSocket which were always null. This
converts the function to a async function and returns a promise which
resolves to the desired values for both getSocket and cancel function.

Co-authored-by: Ashu Ghildiyal <[email protected]>
Signed-off-by: Kautilya Tripathi <[email protected]>
Copy link
Collaborator

@joaquimrocha joaquimrocha left a comment

Choose a reason for hiding this comment

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

I don't understand exactly these changes. Seems like the problem is that getSocket() may return null, but throughout the code that seems to be expected and even accounted for. See e.g. the comment on Termina.tsx:143 (We should only send data if the socket is ready). The solution itself in this PR also seems a bit hacky.

So, even if this fixes things, I would like for a deeper look into the issue and understand exactly whether this is a case where the caller needs to take extra measures.

@knrt10
Copy link
Contributor Author

knrt10 commented Feb 6, 2024

Make sense. I discussed this with @ashu8912 and we agreed that having a socket ready should be in the scope of user. So closing this PR.

@knrt10 knrt10 closed this Feb 6, 2024
@knrt10 knrt10 deleted the fixgetSocket branch February 6, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants