Skip to content

refactor: Refactor WebSocketService to use messenger exposed methods#3917

Merged
Mrtenz merged 3 commits intocontroller-refactorsfrom
mrtenz/websocket-service-refactor
Mar 25, 2026
Merged

refactor: Refactor WebSocketService to use messenger exposed methods#3917
Mrtenz merged 3 commits intocontroller-refactorsfrom
mrtenz/websocket-service-refactor

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Mar 24, 2026

This refactors the WebSocketService to use the messenger exposed methods.


Note

Medium Risk
Moderate risk because it changes how WebSocketService actions are registered/exposed on the messenger and makes previously private methods public, which could break callers relying on old action types or handler names.

Overview
Refactors WebSocketService to register messenger actions via registerMethodActionHandlers using an explicit MESSENGER_EXPOSED_METHODS list, replacing per-action registerActionHandler wiring.

Adds an auto-generated WebSocketService-method-action-types.ts file for strongly-typed method action definitions, updates WebSocketService to use these types, and adjusts exports in websocket/index.ts to export the service class plus selected types (instead of export *).

Written by Cursor Bugbot for commit 44b0f39. This will update automatically on new commits. Configure here.

@Mrtenz Mrtenz marked this pull request as ready for review March 24, 2026 14:51
@Mrtenz Mrtenz requested a review from a team as a code owner March 24, 2026 14:51
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (controller-refactors@95d127d). Learn more about missing BASE report.

Additional details and impacted files
@@                   Coverage Diff                   @@
##             controller-refactors    #3917   +/-   ##
=======================================================
  Coverage                        ?   98.56%           
=======================================================
  Files                           ?      425           
  Lines                           ?    12323           
  Branches                        ?     1935           
=======================================================
  Hits                            ?    12146           
  Misses                          ?      177           
  Partials                        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* @throws If the connection fails.
*/
async #open(snapId: SnapId, url: string, protocols: string[] = []) {
async open(snapId: SnapId, url: string, protocols: string[] = []) {
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, do we strictly need methods available publicly on the service class itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, since they are referenced in the generated types file.

@Mrtenz Mrtenz merged commit 75f65f4 into controller-refactors Mar 25, 2026
127 checks passed
@Mrtenz Mrtenz deleted the mrtenz/websocket-service-refactor branch March 25, 2026 09:23
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