[PR #4210] [MERGED] Use enum for WebSocket message types #9950

Closed
opened 2026-02-07 06:11:21 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/4210
Author: @nielsvanvelzen
Created: 9/25/2020
Status: Merged
Merged: 10/5/2020
Merged by: @Bond-009

Base: masterHead: typed-websocket-message


📝 Commits (1)

  • 72534f9 Use SessionMessageType for WebSocket messages

📊 Changes

24 files changed (+156 additions, -63 deletions)

View changed files

📝 Emby.Dlna/PlayTo/PlayToController.cs (+4 -4)
📝 Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs (+4 -3)
📝 Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs (+6 -5)
📝 Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs (+1 -1)
📝 Emby.Server.Implementations/HttpServer/WebSocketConnection.cs (+3 -2)
📝 Emby.Server.Implementations/Session/SessionManager.cs (+14 -14)
📝 Emby.Server.Implementations/Session/SessionWebSocketListener.cs (+2 -1)
📝 Emby.Server.Implementations/Session/WebSocketController.cs (+2 -1)
📝 Jellyfin.Api/WebSocketListeners/ActivityLogWebSocketListener.cs (+9 -5)
📝 Jellyfin.Api/WebSocketListeners/ScheduledTasksWebSocketListener.cs (+9 -5)
📝 Jellyfin.Api/WebSocketListeners/SessionInfoWebSocketListener.cs (+8 -1)
📝 Jellyfin.Server.Implementations/Events/Consumers/System/TaskCompletedNotifier.cs (+2 -1)
📝 Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationCancelledNotifier.cs (+2 -1)
📝 Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedNotifier.cs (+2 -1)
📝 Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstalledNotifier.cs (+2 -1)
📝 Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallingNotifier.cs (+2 -1)
📝 Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUninstalledNotifier.cs (+2 -1)
📝 Jellyfin.Server.Implementations/Events/Consumers/Users/UserDeletedNotifier.cs (+2 -1)
📝 Jellyfin.Server.Implementations/Events/Consumers/Users/UserUpdatedNotifier.cs (+2 -1)
📝 MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs (+20 -7)

...and 4 more files

📄 Description

While working on the apiclient I needed a list of all websocket message types and found out the server uses strings for those everywhere. I changed it to use an enum to make it easier to see all used types.

Changes

  • Added SessionMessageType enum for incoming and outgoing websocket message types
  • Fixed an issue where sometimes the PlayState command would use Playstate
  • Fixed PluginUninstalledNotifier using the wrong type (PluginUninstalled instead of PackageUninstalled)

Changes should be backwards compatible and confirmed working by running web:master in 2 browsers and using the "play to" feature to connect them. Inspecting all WebSocket messages everything worked fine.

Issues

I guess it's part of #4029


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/4210 **Author:** [@nielsvanvelzen](https://github.com/nielsvanvelzen) **Created:** 9/25/2020 **Status:** ✅ Merged **Merged:** 10/5/2020 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `typed-websocket-message` --- ### 📝 Commits (1) - [`72534f9`](https://github.com/jellyfin/jellyfin/commit/72534f9d667f2457cbe96ea870d140528e366ba2) Use SessionMessageType for WebSocket messages ### 📊 Changes **24 files changed** (+156 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Dlna/PlayTo/PlayToController.cs` (+4 -4) 📝 `Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs` (+4 -3) 📝 `Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs` (+6 -5) 📝 `Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs` (+1 -1) 📝 `Emby.Server.Implementations/HttpServer/WebSocketConnection.cs` (+3 -2) 📝 `Emby.Server.Implementations/Session/SessionManager.cs` (+14 -14) 📝 `Emby.Server.Implementations/Session/SessionWebSocketListener.cs` (+2 -1) 📝 `Emby.Server.Implementations/Session/WebSocketController.cs` (+2 -1) 📝 `Jellyfin.Api/WebSocketListeners/ActivityLogWebSocketListener.cs` (+9 -5) 📝 `Jellyfin.Api/WebSocketListeners/ScheduledTasksWebSocketListener.cs` (+9 -5) 📝 `Jellyfin.Api/WebSocketListeners/SessionInfoWebSocketListener.cs` (+8 -1) 📝 `Jellyfin.Server.Implementations/Events/Consumers/System/TaskCompletedNotifier.cs` (+2 -1) 📝 `Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationCancelledNotifier.cs` (+2 -1) 📝 `Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedNotifier.cs` (+2 -1) 📝 `Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstalledNotifier.cs` (+2 -1) 📝 `Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallingNotifier.cs` (+2 -1) 📝 `Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUninstalledNotifier.cs` (+2 -1) 📝 `Jellyfin.Server.Implementations/Events/Consumers/Users/UserDeletedNotifier.cs` (+2 -1) 📝 `Jellyfin.Server.Implementations/Events/Consumers/Users/UserUpdatedNotifier.cs` (+2 -1) 📝 `MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs` (+20 -7) _...and 4 more files_ </details> ### 📄 Description While working on the apiclient I needed a list of all websocket message types and found out the server uses strings for those everywhere. I changed it to use an enum to make it easier to see all used types. **Changes** - Added `SessionMessageType` enum for incoming and outgoing websocket message types - Fixed an issue where sometimes the `PlayState` command would use `Playstate` - Fixed PluginUninstalledNotifier using the wrong type (`PluginUninstalled` instead of `PackageUninstalled`) Changes should be backwards compatible and confirmed working by running web:master in 2 browsers and using the "play to" feature to connect them. Inspecting all WebSocket messages everything worked fine. **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> I guess it's part of #4029 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:11:21 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#9950