Skip to content

test: Cover SourceFilterSettingsChanged for filter changes - #747

Merged
zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:fix/ws-filter-settings-event-bump
Oct 14, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:fix/ws-filter-settings-event-bump

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a regression test for obs-websocket's SourceFilterSettingsChanged event. The fix itself, obs-rust/obs-websocket#7 (eventhandler: Send SourceFilterSettingsChanged for filter changes), already landed in master with the submodule pin to 547f5ea and shipped in v0.1.0-beta.20261014. This PR does not touch the submodule; it only adds the test, so the bug can't come back unnoticed.

The bug: the event never arrived when a filter's settings changed, whether in the filter's properties in OBS or with SetSourceFilterSettings, while the other filter events (created, removed, renamed, enabled) worked.

  • The event handler only sent SourceFilterSettingsChanged from the core source_update signal. libobs never fires that signal for filters: every filter is created private, and private sources fire no core signals. The fork fix listens on each filter's own update signal, connected and disconnected together with the filter's enable and rename signals, and drops the unreachable filter case from the core handler so one change can never be reported twice.

test_ws_filter_settings_event builds the plugin's event handler from its own sources against real libobs (the frontend calls it makes are stubbed; no websocket server) and records the events it sends for a real input with a real filter. Cases:

  • one filter settings change sends one SourceFilterSettingsChanged with the source, the filter and the new settings;
  • three changes send three, the last with the last settings;
  • a filter removed from its source sends nothing, and sends again once added back;
  • guard: an input settings change still sends InputSettingsChanged, not a filter event.

obs_startup() needs a display on Linux, so there the cases skip without one. The test is built where nlohmann_json is found, and not on Windows, where the frontend stubs would clash with dllimport declarations.

Motivation and Context

Refs #536 (upstream obsproject/obs-websocket#1303, reported by xurei on Ubuntu with OBS 31.0.3). Tazzlyn confirmed it on Windows with OBS 32.0.2. ruggi99 traced it to filters being private and proposed listening on the filter's update signal in obsproject/obs-websocket#1346; the fork fix follows that approach (credited as co-author on the fix and on this test commit).

Why this one: the fix shipped without a test in this repo. This one fails if the filter update connection is ever lost again.

How Has This Been Tested?

On top of current master, in both libobs lanes (ENABLE_RUST_LIBOBS OFF and ON):

  • RED: with the submodule checked out at 3e46553 (the fork commit before Phase 4: stateful, I/O and platform utilities (file serializers, config-file, platform, threading, pipe, task, profiler) #7 was merged, the first parent of 221d2da), test_ws_filter_settings_event fails 3 of 4: settings_change_sends_event, every_change_sends_event and removed_filter_sends_nothing fail, the guard input_change_is_not_filter_event passes. Same in both lanes.
  • GREEN: at 547f5ea (master's pin), 4 of 4 pass in both lanes. Every case ran, none skipped.
  • Full ctest (private Xvfb, system OpenGL module masked as in CI, TMPDIR unset): 204 of 205 in each lane. The failures were master tests this PR doesn't touch, each passing when run alone: test_encoder_group_null (both lanes, first run) and test_video_io_hidden (Rust lane, second run). Every PipeWire and PulseAudio test ran. The skips are open_crashes_without_obs_core and master's test_startup_alloc_stable / test_startup_cycle_stress, which skip here under the nested Xvfb harness and are not touched by this PR.

Not tested: the Windows and macOS builds.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR
  • I am an AI agent being used to assist with this pull request: Claude Code (Claude Opus 5.5) wrote the code, commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

@rdoupe
rdoupe requested a review from zackees as a code owner October 14, 2026 17:34
Changing a filter's settings, in its properties or with
SetSourceFilterSettings, never sent SourceFilterSettingsChanged: the
event handler only listened for it on the core "source_update" signal,
which libobs never fires for filters (they are private sources).
obs-rust/obs-websocket#7 listens on each filter's own "update" signal,
following the approach Ruggero Tomaselli proposed upstream. That fix
already shipped with the submodule pin to 547f5ea; this adds
the regression test.

test_ws_filter_settings_event builds the plugin's event handler from
its sources against real libobs (frontend calls stubbed) and records
the events sent for a real input with a real filter: 3 of 4 cases fail
with the submodule at 3e46553, the fork commit before obs-rust#7 was merged,
and all 4 pass at 547f5ea.

Reported upstream in obsproject/obs-websocket#1303 by xurei.

Refs obs-rust#536.

Co-Authored-By: Ruggero Tomaselli <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc secs=528 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1792000162,"gate":"rust/all/fmt","host":"linux-x86_64","key":"9b0287efef1ab79656e10f25444ba35d3d1dbd37d85567a55809386cb0b5a229","lane":"lint","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":58,"stamp":"a01fb9eaf38829a4506c4ccbbf76595b","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"9b0287efef1ab79656e10f25444ba35d3d1dbd37d85567a55809386cb0b5a229","lane":"lint","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":58,"stamp":"50041ceb0a8a0d3a48446ba61bc53ea5","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"cadc5a810b344592f1f506d6ddcf982f79c923836510cc55c6b593268780798c","lane":"rust-test","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":132,"stamp":"df532c31549d54ba452ea0fe8ed508aa","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"55fa0daa0eff2ebcdd41b3941bca2c001a0c3998b942ad3d5df12400cdc80383","lane":"cross","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":116,"stamp":"3d47000911152743b68d377b573816a5","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"55fa0daa0eff2ebcdd41b3941bca2c001a0c3998b942ad3d5df12400cdc80383","lane":"cross","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":116,"stamp":"8ab363dc685be71ade04936ec0f4602f","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"55fa0daa0eff2ebcdd41b3941bca2c001a0c3998b942ad3d5df12400cdc80383","lane":"cross","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":116,"stamp":"707c852029b1b3cf84349bc9f1210e3f","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"55fa0daa0eff2ebcdd41b3941bca2c001a0c3998b942ad3d5df12400cdc80383","lane":"cross","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":116,"stamp":"7cb431c264b4b57fcefaf24aec71b6b2","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"55fa0daa0eff2ebcdd41b3941bca2c001a0c3998b942ad3d5df12400cdc80383","lane":"cross","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":116,"stamp":"5d6d37a2248e04abe2c50427a38d4c2d","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"55fa0daa0eff2ebcdd41b3941bca2c001a0c3998b942ad3d5df12400cdc80383","lane":"cross","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":116,"stamp":"04dea621c47f8a473f27e04551531028","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
Ci-Attestation: {"at":1792000162,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"e4c49bd9a27c3410632681decbebf09e52bfa0c7bb316cf1386fbc53c25ebdde","lane":"tier2-linux","parents":["a48a9a13d80d3ac5ded749093e6ac2a08855e189"],"secs":222,"stamp":"5dc4379d36d841b98a449b2108283ef3","tree":"8b10f67b62e1a9d18ccda31dea73ac0af8dcf0bc","v":1,"via":"run"}
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Rebased onto master and ran the stamped local gate. Your RED (test fails against the obs-websocket commit before the fix) / GREEN (passes at master's pin) evidence above stands; this PR adds only the test and doesn't move the submodule.

  • Rebased on master, local gate passed; pushed as 57e4d52.

@zackees
zackees force-pushed the fix/ws-filter-settings-event-bump branch from cf24536 to 57e4d52 Compare October 14, 2026 17:49
@zackees
zackees added this pull request to the merge queue Oct 14, 2026
Merged via the queue into obs-rust:master with commit 287c02b Oct 14, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants