acdream/tests
Erik a34e8f2a17 fix #420: seed face-segment media states so character select stops crashing the client
Every launcher-started play session on 2026-08-19 died a few seconds after
login. The user's own session evidence shows it three times in a row:
started -> connected -> characterList -> exited code 1 "crashed", with
client.err.log carrying

  System.ArgumentNullException: Value cannot be null. (Parameter 'key')
     at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
     at AcDream.App.UI.UiButton.OnDraw(UiRenderContext ctx)

UiButton allocated its per-face-segment media-state array as `new string[n]`,
leaving every element null, while the single-face sibling _faceMediaState was
correctly seeded to "" (DirectState). NextMediaState returns `current`
unchanged on three of its four arms — including retail's own "committed state
authored with an empty media array keeps the previous media playing" rule — so
on a multi-segment button whose committed state carries no media the null
survived the first SyncMediaStates and reached
ElementInfo.StateMedia.TryGetValue(null), throwing mid-paint and taking the
process down.

Seed the array with "" at construction. That is what the constructor's
existing comment already claimed the media machine did ("the media machine
begins on the element's BASE media"); only the segment array was left out.

Verified by reverting the one-line fix: the new regression test throws
ArgumentNullException from UiButton.ActiveFile, the same frame as the live
crash. AcDream.App.Tests UiButton filter: 41 passed, 3 skipped.

Found while investigating Campaign LU item 4 ("launching the selected
character doesn't work") — this is why nothing worked. Also lands the Campaign
LU plan doc, whose recon section records the mechanisms the remaining slices
build on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 18:32:28 +02:00
..
AcDream.App.Tests fix #420: seed face-segment media states so character select stops crashing the client 2026-08-19 18:32:28 +02:00
AcDream.Bake.Tests test: make prerequisite lanes fail honestly 2026-08-18 12:09:41 +02:00
AcDream.Cli.Tests build: make release restore reproducible 2026-08-18 10:29:00 +02:00
AcDream.Content.Tests test: replace campaign labels with behavior names 2026-08-18 12:25:00 +02:00
AcDream.Core.Net.Tests test: introduce Lane=Timing for load-sensitive tests, and stop chasing them individually 2026-08-19 15:29:10 +02:00
AcDream.Core.Tests ci: tag DAT-dependent tests into the InstalledDat lane; drop invariant workaround 2026-08-19 11:19:14 +02:00
AcDream.Core.Tests.Fixtures.HelloPlugin build: make release restore reproducible 2026-08-18 10:29:00 +02:00
AcDream.Headless.Tests test: replace final fixed-delay oracles 2026-08-18 13:12:26 +02:00
AcDream.Launcher.Core.Tests test: introduce Lane=Timing for load-sensitive tests, and stop chasing them individually 2026-08-19 15:29:10 +02:00
AcDream.Launcher.Core.Tests.Fixtures.ConsolelessSupervisorParent build: make release restore reproducible 2026-08-18 10:29:00 +02:00
AcDream.Launcher.Core.Tests.Fixtures.ConsoleSignalChild build: make release restore reproducible 2026-08-18 10:29:00 +02:00
AcDream.Launcher.Core.Tests.Fixtures.InstallLeaseHolder build: make release restore reproducible 2026-08-18 10:29:00 +02:00
AcDream.Launcher.Tests test: lane the one Avalonia test that needs a real desktop session 2026-08-19 14:15:21 +02:00
AcDream.Platform.Tests build: make release restore reproducible 2026-08-18 10:29:00 +02:00
AcDream.Plugin.Tests.Fixtures.HostPlugin build: make release restore reproducible 2026-08-18 10:29:00 +02:00
AcDream.Runtime.Tests test: replace campaign labels with behavior names 2026-08-18 12:25:00 +02:00
AcDream.UI.Abstractions.Tests test: remove dormant panel self-tests 2026-08-18 14:37:42 +02:00
Fixtures/campaign-la fix(plugins): close LA5 host lifecycle review 2026-08-14 19:05:13 +02:00