Skip to content

Conversation

@tieneupin
Copy link
Contributor

@tieneupin tieneupin commented May 15, 2025

Previously, the websocket connection would be prone to breaking, preventing logs from the client from being displayed in the loggers set up on the server side. This problem got even more pronounced as the Murfey ecosystem became more complicated, especially with the addition of a React app frontend and having NGINX manage incoming connections.

This PR seems to have resolved this issue (confirmed after multiple runs of the data transfer workflow with both the instrument server and TUI modes of transfer happening simultaneously) by encasing the WebSocketApp.send() and WebSocketApp.close() commands in a try-except block. Additionally, the ping_interval parameter was added to the WebSocketApp.run_forever() function to prevent the connection from closing when the client is idling.

Also tidies up and adds comments to describe the code in murfey.client.__init__.

@codecov
Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 26.92308% with 19 lines in your changes missing coverage. Please review.

Project coverage is 30.18%. Comparing base (59297f9) to head (d1640c0).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #592      +/-   ##
==========================================
- Coverage   30.19%   30.18%   -0.02%     
==========================================
  Files          80       80              
  Lines       10567    10574       +7     
  Branches     1410     1410              
==========================================
+ Hits         3191     3192       +1     
- Misses       7270     7276       +6     
  Partials      106      106              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tieneupin tieneupin marked this pull request as ready for review May 15, 2025 16:56
@tieneupin tieneupin requested a review from d-j-hatton May 15, 2025 16:57
@tieneupin tieneupin self-assigned this May 15, 2025
@tieneupin tieneupin added bug Something isn't working server Relates to the server component client Relates to the client component labels May 15, 2025
@tieneupin tieneupin merged commit 4f1cd29 into main May 20, 2025
17 checks passed
@tieneupin tieneupin deleted the websocket-fix branch May 20, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working client Relates to the client component server Relates to the server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants