Repository navigation
obs-websocket: Show session durations of a minute and longer - #1145
Conversation
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>
|
Submodule check: this PR moves Please bump this one to |
|
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:
You are going to have to rebase, but it's worth it! |
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>
32c7028 to
5f9d492
Compare
|
Bumped: the GREEN commit (now 5f9d492) moves |
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.
SettingsDialog::FillSessionTable()(plugins/obs-websocket/src/forms/SettingsDialog.cppline 252) formatted the duration withQTime(0, 0, sessionDuration).toString("hh:mm:ss").QTime(h, m, s)only takessfrom 0 to 59, so from 60 seconds on the QTime was invalid,toString()returned an empty string, and the cell stayed empty for the rest of the session while the client was still connected.FormatSessionDuration()(new headersrc/forms/SessionDuration.h) and buildshh:mm:ssfrom the seconds count. The hours count on past 24 (QTime(0, 0).addSecs()would wrap after a day), and a negative count (the clock set back below the connect time) shows 00:00:00. This PR moves the submodule to it.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:RED → GREEN
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 intoFormatSessionDuration()unchanged (stillQTime(0, 0, seconds)).test_ws_session_durationbuilds 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_dayandclock_set_back. The controlunder_a_minutepasses. Registered on every platform withcmocka_qt_runtime().plugins/obs-websocketfrom 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 withENABLE_RUST_LIBOBSOFF and ON. Full OBS build (frontend + obs-websocket) in both lanes. Full ctest -j8 (private Xvfb, systemlibobs-openglmasked, TMPDIR unset): 267/267 in both lanes. Every PipeWire/PulseAudio test ran; skipped onlyopen_crashes_without_obs_core(both lanes) andtest_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 intest_pulse_stream_restart,test_pulse_monitor_reset_shared_failed_context_reset_recovers,test_pipewire_screencast_shmandtest_ws_transform_bounds(none touched here); the rerun at normal load passed them all. clang-format 22.1.3, gersemi andci/test_registration.pyclean.Checklist
master-W..., ratchets): noneAI 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