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

fix: OnConnected is called with a copied context. #336

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tttoad
Copy link

@tttoad tttoad commented Jan 7, 2025

see #335.

@tttoad tttoad requested a review from a team as a code owner January 7, 2025 10:12
@tigrannajaryan
Copy link
Member

Unclear what problem this is solving. Also, we need tests verifying and demonstrating the bug.

@tttoad
Copy link
Author

tttoad commented Jan 8, 2025

Unclear what problem this is solving. Also, we need tests verifying and demonstrating the bug.

When the connection is established, I will write the information about the connection to storage.
I will pass the context into e.g. (go-redis,gorm...) and they will check if the context has been canceled. When the http request is disconnected, the context will be canceled and the data writing is not finished yet (handleWSConnection is asynchronous) and it will report context canceled.

That context is canceled if the HTTP client disconnects or cancels the HTTP request (possible in HTTP/2).

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