Skip to content

obs-websocket: Show session durations of a minute and longer - #1145

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/ws-session-duration
Oct 17, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/ws-session-duration

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1116

What and why

The Session Duration column in Tools > WebSocket Server Settings now keeps counting after the first minute instead of going blank.

Reproduced in release v0.1.0-beta.20261014 (AppImage, headless: private Xvfb, private HOME, dbus-run-session, --multi), websocket server with a password and one identified client that stays connected; Tools > WebSocket Server Settings opened through the menu with XTest clicks, the session row read from a screenshot:

Build ~30 s after connecting ~70 s after connecting
v0.1.0-beta.20261014 00:00:32 (empty), messages still counting
This branch, C libobs lane 00:00:31 00:01:12
This branch, Rust libobs lane 00:00:32 00:01:12

RED → GREEN

  • RED commit: 6f2980e test/cmocka: Add failing test for the websocket Session Duration text. It moves the submodule from master's pin f06b040 to 6f3efa3, the fork PR's first commit, which moves the formatting into FormatSessionDuration() unchanged (still QTime(0, 0, seconds)). test_ws_session_duration builds that header with Qt Core only (no libobs, no display) and fails 4 of 5 cases in both lanes: one_minute_and_more ("" != "00:01:00"), hours, more_than_a_day and clock_set_back. The control under_a_minute passes. Registered on every platform with cmocka_qt_runtime().
  • GREEN: 32c7028 moves plugins/obs-websocket from 6f3efa3 to 8bca4ac, the fix (8bca4ac once forms: Show session durations of a minute and longer obs-websocket#15 merges; forward only). 5 of 5 with ENABLE_RUST_LIBOBS OFF and ON. Full OBS build (frontend + obs-websocket) in both lanes. Full ctest -j8 (private Xvfb, system libobs-opengl masked, TMPDIR unset): 267/267 in both lanes. Every PipeWire/PulseAudio test ran; skipped only open_crashes_without_obs_core (both lanes) and test_startup_shutdown_cycles (C lane), the same skips earlier master runs here showed. A first full run under heavy load from other jobs on the machine had timing failures in test_pulse_stream_restart, test_pulse_monitor_reset_shared_failed_context_reset_recovers, test_pipewire_screencast_shm and test_ws_transform_bounds (none touched here); the rerun at normal load passed them all. clang-format 22.1.3, gersemi and ci/test_registration.py clean.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): none
  • Intentional differences from C listed in the parity test header and rust/README.md (ports): not a port

AI note: Claude Code (Claude Opus 5.5) wrote the code, the test, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

Tools > WebSocket Server Settings lists the connected clients with their
Session Duration as hh:mm:ss. The dialog formatted it with
QTime(0, 0, seconds), and QTime only takes 0 to 59 seconds: from one
minute on the QTime is invalid, so the cell is empty for the rest of the
session (upstream obsproject/obs-websocket#1208).

Moves the submodule to the fork commit "forms: Move the session duration
text into a helper", which moves that formatting, unchanged, into
FormatSessionDuration() (forms/SessionDuration.h). test_ws_session_duration
builds the header on its own with Qt Core. Four cases fail: one minute
and more, hours, more than a day, and a clock set back. The first
minute passes.

Refs obs-rust#1116.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zackees
zackees enabled auto-merge October 17, 2026 01:49
@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Submodule check: this PR moves plugins/obs-websocket from f06b040 to 8bca4ac (#15 only). #1146 moves it to d79d2c2 (#15 + #16). If #1146 merges first, this PR then moves the pointer back to 8bca4ac and silently removes the screenshot fix. We had this happen before with #492.

Please bump this one to d79d2c2 as well, so both PRs agree and the order doesn't matter. #16 only touches the screenshot code, so it doesn't affect test_ws_session_duration. Until then I'll queue this PR before #1146.

@zackees
zackees added this pull request to the merge queue Oct 17, 2026
@zackees

zackees commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Part one of the speed up refactor has gone in. C code is amalgamated and relies on one single PCH

Part two, going in now, is rust optimization:

  • unit test amalgamation
  • artifact caching

You are going to have to rebase, but it's worth it!

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 17, 2026
@zackees
zackees added this pull request to the merge queue Oct 17, 2026
Moves the submodule to the fork fix "forms: Show session durations of a
minute and longer", and on to d79d2c2, the same commit obs-rust#1146 uses, so
the two PRs agree whichever merges first (d79d2c2 adds only the
screenshot fix for obs-rust#1141 on top). The Session Duration column of the obs-websocket
settings dialog went empty after 59 seconds because QTime(0, 0, s)
rejects 60 seconds and more (upstream obsproject/obs-websocket#1208,
reported by bryce-seifert; DanielLester83 found the QTime limit in
obsproject/obs-websocket#1179). FormatSessionDuration() now builds
hh:mm:ss from the seconds count, with the hours counting on past 24 and
a clock set back showing 00:00:00.

test_ws_session_duration passes 5 of 5.

Fixes obs-rust#1116.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rdoupe
rdoupe force-pushed the fix/ws-session-duration branch from 32c7028 to 5f9d492 Compare October 17, 2026 08:02
@rdoupe

rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

Bumped: the GREEN commit (now 5f9d492) moves plugins/obs-websocket to d79d2c2, the same commit #1146 uses. Whichever of the two merges first, the other no longer moves the pointer back. d79d2c2 adds only the #1141 screenshot change on top of 8bca4ac. I'll rebase onto master once part two of the refactor is in.

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.

bug: obs-websocket: Session Duration in WebSocket Server Settings goes blank after 59 seconds (upstream obs-websocket#1208)

2 participants