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: removed ping method in WS server #2394

Conversation

quiet-node
Copy link
Member

Description:
This PR removes the ping method in the WS server to stop the server from repeatitively sending null responses back to client

misc: renamed one of the test case which was incorrect

Related issue(s):

Fixes #2359

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@quiet-node quiet-node self-assigned this Apr 23, 2024
@quiet-node quiet-node linked an issue Apr 23, 2024 that may be closed by this pull request
@quiet-node quiet-node added the bug Something isn't working label Apr 23, 2024
Copy link

github-actions bot commented Apr 23, 2024

Tests

    2 files  147 suites   13s ⏱️
815 tests 814 ✔️ 1 💤 0
827 runs  826 ✔️ 1 💤 0

Results for commit 354b630.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

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

There is an error linting the charts.

@quiet-node quiet-node force-pushed the 2359-ws-socket-repetitively-responds-with-null-responses-when-subcribed branch from 6afbb25 to d04af53 Compare April 23, 2024 19:48
Copy link

github-actions bot commented Apr 23, 2024

Acceptance Tests

  14 files  191 suites   16m 19s ⏱️
579 tests 576 ✔️ 3 💤 0
614 runs  611 ✔️ 3 💤 0

Results for commit 354b630.

♻️ This comment has been updated with latest results.

@quiet-node quiet-node force-pushed the 2359-ws-socket-repetitively-responds-with-null-responses-when-subcribed branch from d04af53 to 27351ef Compare April 23, 2024 23:28
Signed-off-by: Logan Nguyen <[email protected]>
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Comment on lines 203 to 207
describe('Subscriptions for newHeads', async function () {
it('should subscribe to newHeads, include transactions true, and receive a valid JSON RPC response', (done) => {
process.env.WS_NEW_HEADS_ENABLED = 'true';
const webSocket = new WebSocket(WS_RELAY_URL);
const subscriptionId = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We can extract the common setup logic in beforeEach:

  describe('Subscriptions for newHeads', async function () {
+   let webSocket: WebSocket;
+   const subscriptionId = 1;
+
+   beforeEach(() => {
+      process.env.WS_NEW_HEADS_ENABLED = 'true';
+.     webSocket = new WebSocket(WS_RELAY_URL);
+   });

    it('should subscribe to newHeads, include transactions true, and receive a valid JSON RPC response', (done) => {
-     process.env.WS_NEW_HEADS_ENABLED = 'true';
-     const webSocket = new WebSocket(WS_RELAY_URL);
-     const subscriptionId = 1;
      ...
    });
    
    it('should subscribe to newHeads, without the "include transactions", and receive a valid JSON RPC response', (done) => {
-     process.env.WS_NEW_HEADS_ENABLED = 'true';
-     const webSocket = new WebSocket(WS_RELAY_URL);
-     const subscriptionId = 1;
      ...
    });

    it('should subscribe to newHeads, with "include transactions false", and receive a valid JSON RPC response', (done) => {
-     process.env.WS_NEW_HEADS_ENABLED = 'true';
-     const webSocket = new WebSocket(WS_RELAY_URL);
-     const subscriptionId = 1;
      ...
    });

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice suggestion thanks a lot!

Copy link
Collaborator

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LG, @victor-yanev comment is a good improvement.

But more importantly, have we been able to resolve the issue that is closing the connection after 100 seconds? we decided to support 5 minutes right?

Should we want to remove this ping feature before being able to resolve the issue on the infrastructure?

@quiet-node quiet-node marked this pull request as draft April 24, 2024 15:44
@quiet-node quiet-node closed this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WS socket repetitively responds with null responses when subcribed
4 participants