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

[BUG] #131

Open
tgudelj opened this issue Oct 26, 2023 · 0 comments
Open

[BUG] #131

tgudelj opened this issue Oct 26, 2023 · 0 comments

Comments

@tgudelj
Copy link

tgudelj commented Oct 26, 2023

Issue Type

Multi-threading issue with sequence of events

  • Bug

Describe the bug
I don't know if it is a bug or feature, but in some cases it will manifest as a bug:
obs-websocket-dotnet handles messages received from obs in parallel, spawns a new thread for each message received:

wsConnection.MessageReceived.Subscribe(m => Task.Run(() => WebsocketMessageHandler(this, m)))

In WebsocketMessageHandler if message is an event it again spawns a thread to process the event

Task.Run(() => { ProcessEventType(eventType, body); });

The net result is that events are not processed in sequence of arrival and obs-websocket-dotnet events are not raised in actual sequence they arrived from OBS. So why does it matter?

Well, in my case I was trying to synchronize a slider UI control to input volume, updating the slider position on InputVolumeChanged. Let's say user changed volume from 10 to 0, I'd expect sequence like 10,9,7,6,5,3,2,0 and instead get 10, 7, 5, 6, 2, 1, 0, 3.

Again, I'm not sure if this should be classified as bug or not, but in my particular case sequence of events does matter

To Reproduce
see description

Expected behavior
Events raised in order they are sent by OBS websocket

Versions
OBS Version:
OBS WebSocket Version: 5.x
OBS WebSocket Dotnet (this library) Version: 5.x
OS: [e.g. Windows 10]

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

No branches or pull requests

1 participant