onflow / flow-go

A fast, secure, and developer-friendly blockchain built to support the next generation of games, apps, and the digital assets that power them.
GNU Affero General Public License v3.0
533 stars 179 forks source link

[Access] Configure ws connection in ws controller #6750

Open UlyanaAndrukhiv opened 1 week ago

UlyanaAndrukhiv commented 1 week ago

Closes: #6638

Context

This PR implements the initial WebSocket connection configuration for the new WebSocket controller. The changes focus on setting up timeouts and ensuring the connection remains responsive, preventing the server from blocking indefinitely while waiting for the client to send or receive messages:

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 50.00000% with 17 lines in your changes missing coverage. Please review.

Project coverage is 41.22%. Comparing base (8a3055c) to head (04e392c).

Files with missing lines Patch % Lines
engine/access/rest/websockets/controller.go 46.42% 11 Missing and 4 partials :warning:
...access/rest/websockets/legacy/websocket_handler.go 66.66% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6750 +/- ## ========================================== - Coverage 41.26% 41.22% -0.04% ========================================== Files 2061 2061 Lines 182702 182728 +26 ========================================== - Hits 75384 75333 -51 - Misses 101010 101077 +67 - Partials 6308 6318 +10 ``` | [Flag](https://app.codecov.io/gh/onflow/flow-go/pull/6750/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=onflow) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/onflow/flow-go/pull/6750/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=onflow) | `41.22% <50.00%> (-0.04%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=onflow#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

illia-malachyn commented 2 days ago

LGTM! Let's add tests for this in this PR as they're related https://github.com/onflow/flow-go/pull/6757