Skip to content

frontend: Migrate pre-31 settings that lack LastVersion - #816

Merged
zackees merged 2 commits into
obs-rust:masterfrom
vpacher:fix/pre31-migration
Oct 15, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
vpacher:fix/pre31-migration

Conversation

@vpacher

@vpacher vpacher commented Oct 15, 2026

Copy link
Copy Markdown
Member

Fixes #815

What and why

A config from OBS before 31.0 whose global.ini has no LastVersion (OBS never exited cleanly, for example when it runs as a service) was treated as a fresh install. Its user settings were not copied to user.ini, and the first start opened the auto-configuration wizard. While the wizard is open, all outputs are disabled (AutoConfig calls EnableOutputs(false)), and on an unattended host nobody sees it. The fork reaches this path on its first start after MigrateRustConfiguration() copied an upstream 30.x config.

This PR also migrates when LastVersion is missing, if global.ini has [General] FirstRun (written there only by OBS before 31.0) and user.ini does not exist:

  • A fresh install has no FirstRun in global.ini, so it still gets the wizard.
  • With an existing user.ini, nothing is migrated: MigrateGlobalSettings() would show an error box.
  • With LastVersion set, nothing changes.

The decision is in a new Qt-free header, frontend/utility/settings-migration.hpp (ShouldMigratePre31Settings()). OBSApp::InitGlobalConfig() uses it.

RED → GREEN

  • RED commit: 9a627a3. test_settings_migration: 1 of 6 cases fails (missing_last_version_with_legacy_settings_migrates). The 5 guard cases pass (fresh install, existing user.ini, LastVersion 30.2.3, already migrated, LastVersion 32.0).
  • GREEN: 3a44350. test_settings_migration 6/6.

End-to-end check (not part of CI), on Debian 13, headless, OBS started by a systemd unit, with a ~/.config/obs-studio from OBS 30.2.3 without LastVersion:

  • Before: user.ini has only defaults, the wizard window is open, and a websocket StartRecord returns success but nothing is recorded.
  • After: no wizard. user.ini has the migrated settings (82 lines: [Video], [BasicWindow], plugin sections, FirstRun=true), global.ini has Pre31Migrated=true, and StartRecord records.

Checklist

  • Base is master (or the description starts with a Stacked: note)
  • 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

Notes:

  • clang-format 22.1.3 and gersemi 0.25.0 were run on the changed files. The full ./lint and the local gate were not run.
  • This PR and frontend: Restore --disable-shutdown-check #810 both add an #include in frontend/OBSApp.cpp and a header line in frontend/cmake/ui-utility.cmake at the same place. Whichever merges second needs a trivial rebase (keep both lines); I will do it.

🤖 Generated with Claude Code

Move the decision whether to copy the pre-31 global.ini settings to
user.ini into frontend/utility/settings-migration.hpp
(ShouldMigratePre31Settings), free of Qt, and add
test_settings_migration. No change in behaviour.

RED for obs-rust#815: the case "no LastVersion, FirstRun in global.ini, no
user.ini" fails, because the helper treats it as a fresh install.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vpacher
vpacher requested a review from zackees as a code owner October 15, 2026 08:18
@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 15, 2026
OBS writes LastVersion only on a clean exit. A global.ini from OBS
before 31.0 that was never closed cleanly has none, so its settings
were not copied to user.ini. The first start then opened the
auto-configuration wizard, which disables all outputs while it is open.

Also migrate when LastVersion is missing, if global.ini has FirstRun
(written there only by OBS before 31.0) and user.ini does not exist.
A fresh install still gets the wizard.

GREEN for obs-rust#815.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=47ad1a35448c74845ea870dd4b774190dda5e194 secs=1360 lanes=lint:run,rust-test:reused@241456d52183,cross:reused@b456eff62019,tier2-linux:run
Ci-Attestation: {"at":1792053820,"gate":"rust/all/fmt","host":"linux-x86_64","key":"63752c72cced08d0bd05965bb758ad3c8ee6093f8ca6541091135e01e0fbf41f","lane":"lint","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":52,"stamp":"e1870d61ecc347683e20e544b0d02cf4","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"run"}
Ci-Attestation: {"at":1792053820,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"63752c72cced08d0bd05965bb758ad3c8ee6093f8ca6541091135e01e0fbf41f","lane":"lint","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":52,"stamp":"2f36802177ae41fce5dfa966e95e4dea","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"run"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"241456d52183502cf4b88cfa70413b65dfc08dc645f90e8d74ed72769dac7fe4","lane":"rust-test","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":null,"stamp":"e229366ddf5f5fddcbc014f0de97de26","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":null,"stamp":"dac4e9a2160301adf291a8fce753e6f1","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":null,"stamp":"73f713cd6edb993a71ce2ed2117e8bd0","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":null,"stamp":"e24809444f638a183f3e8dfcedab6cb9","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":null,"stamp":"2cc3701d35d1f59132738e0a43d46e8d","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":null,"stamp":"c4867a596da35fac2ecc68a898fc44ca","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":null,"stamp":"e851831e46e8c8e013880d7bf81e5c37","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"reused"}
Ci-Attestation: {"at":1792053820,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"c1b2749474765dd45a3d350a34909b583c416ba937e8f92fafc3e36e50493b13","lane":"tier2-linux","parents":["9a627a362327b14dbb1508c57ead2bd5d1763bc4"],"secs":1308,"stamp":"c3cf3a29b073be6841168db7fd211335","tree":"47ad1a35448c74845ea870dd4b774190dda5e194","v":1,"via":"run"}
@zackees

zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member

Rebased onto master, set ci-full (frontend change), and ran the stamped local gate. Your RED (9a627a3: missing_last_version_with_legacy_settings_migrates fails, 5 guards pass) / GREEN (3a44350: 6/6) evidence stands.

  • Rebased on master, local gate passed; pushed as 9b6b51d.

@zackees
zackees force-pushed the fix/pre31-migration branch from 3a44350 to 9b6b51d Compare October 15, 2026 08:43
@zackees
zackees enabled auto-merge October 15, 2026 08:43
@zackees
zackees added this pull request to the merge queue Oct 15, 2026
Merged via the queue into obs-rust:master with commit 889136d Oct 15, 2026
26 checks passed
@zackees zackees mentioned this pull request Oct 15, 2026
5 of 6 tasks
@vpacher
vpacher deleted the fix/pre31-migration branch October 15, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: frontend: a pre-31 config without LastVersion is not migrated; the hidden first-run wizard disables all outputs

2 participants