Skip to content

frontend: Don't log a failed scene migration on every fresh profile - #419

Merged
zackees merged 4 commits into
masterfrom
fix/155-scene-migration
Oct 13, 2026
Merged

zackees merged 4 commits into
masterfrom
fix/155-scene-migration

Conversation

@zackees

@zackees zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Closes #155.

move_basic_to_scene_collections() migrates the legacy basic/scenes.json. It returned early only when the basic/ directory was missing, but MakeUserDirs() always creates that directory. So every fresh profile created basic/scenes/ and then logged Failed to rename basic scene collection file for a file that never existed.

  1. Extract (behavior-neutral): the migration body moves to frontend/utility/scene-collection-migration.{hpp,cpp} (migrate_basic_scene_collection), with no Qt or OBSApp dependency. OBSApp.cpp keeps the config-path lookup and passes in App()->userScenesLocation and Str("Untitled").
  2. RED: test_scene_collection_migration (cmocka, tests.d/) counts LOG_ERRORs through base_set_log_handler in a temp dir. The fresh-profile case fails. The legacy-file and already-migrated cases pass and pin the existing behavior.
  3. GREEN: return early when scenes.json doesn't exist, before creating basic/scenes/.

Tier 2: 138/138 pass with ENABLE_RUST_LIBOBS OFF and ON. The local gate passed and is stamped. OBSApp.cpp and the new helper's frontend build are checked by this PR's full OBS builds.

Behavior-neutral: move_basic_to_scene_collections keeps the config path
lookup and calls migrate_basic_scene_collection, which has no Qt or
OBSApp dependency so it can be unit tested.

Refs #155
…o migrate (GREEN)

A fresh profile has a basic/ directory (MakeUserDirs makes it) but no
legacy scenes.json, so the migration made basic/scenes/ and logged a
failed rename on every first launch.

Closes #155

Local-Gate: v1 tree=32db90988a5f92155c180e20b488c0745cd63346 secs=139 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791853035,"gate":"rust/all/fmt","host":"linux-x86_64","key":"d0785f93fa1c5efb52d34f63284d0c573fce06ea4d7e037f0905a57e94ac9f89","lane":"lint","parents":["d30d71ba45a6d5d1252215f6882ca2b54ec7da35"],"secs":20,"stamp":"a8ef2bf94ba2630a98e2318908d692ec","tree":"32db90988a5f92155c180e20b488c0745cd63346","v":1,"via":"run"}
Ci-Attestation: {"at":1791853035,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"d0785f93fa1c5efb52d34f63284d0c573fce06ea4d7e037f0905a57e94ac9f89","lane":"lint","parents":["d30d71ba45a6d5d1252215f6882ca2b54ec7da35"],"secs":20,"stamp":"1bfd22539c90a1d7a4ab5bde4dfb16c6","tree":"32db90988a5f92155c180e20b488c0745cd63346","v":1,"via":"run"}
Ci-Attestation: {"at":1791853035,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"77102f43849fd8edca00027b0fa8a0799dc52c6b66da8a411f071de631973a8a","lane":"rust-test","parents":["d30d71ba45a6d5d1252215f6882ca2b54ec7da35"],"secs":48,"stamp":"b481b2edf77a3faef2fb745014594f08","tree":"32db90988a5f92155c180e20b488c0745cd63346","v":1,"via":"run"}
Ci-Attestation: {"at":1791853035,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"14f2ae6e29a94e029caa9ae4c284661e9b14344db9d7303b890051ef9cc999d4","lane":"tier2-linux","parents":["d30d71ba45a6d5d1252215f6882ca2b54ec7da35"],"secs":70,"stamp":"62d4957447c785e48bca875a0578a083","tree":"32db90988a5f92155c180e20b488c0745cd63346","v":1,"via":"run"}
The Windows cmocka.h has no extern "C" guard, so the C++ test looked
for mangled _assert_true and failed to link.

Refs #155

Local-Gate: v1 tree=6bb2107a6eb8288cf3d2f9d471d0b598a6f150c4 secs=131 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791854003,"gate":"rust/all/fmt","host":"linux-x86_64","key":"46b44f107c155f93a7fe71b0eaf4a26df271bb30344b6ce0cdf16fbf2eef8685","lane":"lint","parents":["71a5bebcbf7e8deda8e02a7e6feff44bccfbdc63"],"secs":19,"stamp":"28cfb031ffb07ae2e5d1773d5c541e4b","tree":"6bb2107a6eb8288cf3d2f9d471d0b598a6f150c4","v":1,"via":"run"}
Ci-Attestation: {"at":1791854003,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"46b44f107c155f93a7fe71b0eaf4a26df271bb30344b6ce0cdf16fbf2eef8685","lane":"lint","parents":["71a5bebcbf7e8deda8e02a7e6feff44bccfbdc63"],"secs":19,"stamp":"8a6dd0b21ae5aa83c7f714b344479a83","tree":"6bb2107a6eb8288cf3d2f9d471d0b598a6f150c4","v":1,"via":"run"}
Ci-Attestation: {"at":1791854003,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"587f5c0c64a9eecb1fc83fc7bd668ae04578f91a946dbcfd8e4b955fc1285c36","lane":"rust-test","parents":["71a5bebcbf7e8deda8e02a7e6feff44bccfbdc63"],"secs":45,"stamp":"e358136df02d338236cc863760bd737e","tree":"6bb2107a6eb8288cf3d2f9d471d0b598a6f150c4","v":1,"via":"run"}
Ci-Attestation: {"at":1791854003,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"fde8e4a39e719ae0fb7f7d9db7e13f78ae05828622a1e75963041a01eae321db","lane":"tier2-linux","parents":["71a5bebcbf7e8deda8e02a7e6feff44bccfbdc63"],"secs":67,"stamp":"a9a04ce273b2d1cb6f1f42683a2cb2e5","tree":"6bb2107a6eb8288cf3d2f9d471d0b598a6f150c4","v":1,"via":"run"}
@zackees
zackees merged commit 5810cb2 into master Oct 13, 2026
23 checks passed
@zackees
zackees deleted the fix/155-scene-migration branch October 26, 2026 15:43
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.

Frontend: spurious 'Failed to rename basic scene collection file' on every fresh profile

1 participant