fix(go-live): the Start Stream dialog re-reads Stream Info at open
Creator went live on the Debug build while the Release build was recording and got an empty
title/description, with the Stream Info tab filled in on screen. Both processes write to the same
profile: `BroadcastForm` is loaded ONCE at startup and each keystroke persists straight to the store,
so the instance that opened the dialog was holding the form as it was when it launched — before the
other instance saved those fields. The dialog copied from that stale copy.
`CreateGoLiveDialog` (new, extracted so it can be tested without showing a window) calls
`BroadcastForm.Load()` before composing the dialog. That is what the form's own doc comment always
claimed ("startup / Go Live refresh") but the refresh was never wired. It cannot lose an edit: every
keystroke is already persisted.
The dialog also logs `Go Live dialog: title='…' description=N chars`, so the next report of "the
dialog was blank" says immediately whether the values reached the dialog or never left the store.
Test: `BroadcastPullOutTests` writes metadata through a second `LayoutStore` handle (the other
instance) after the VM has loaded and asserts the dialog carries it. 572 green, 0 warnings.
This commit is contained in:
@@ -96,13 +96,25 @@ public partial class MainViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
private void BeginGoLive(bool alsoRecord)
|
||||
/// <summary>Builds the Start Stream dialog's model from the Stream Info tab. Re-reads the store
|
||||
/// first: the form is loaded once at startup, and a second LlamaCasty on the same profile (the dev
|
||||
/// instance, or Release recording while Debug goes live) writes its edits straight to the store, so
|
||||
/// this process's copy can be empty while the tab the creator filled in is not (2026-11-06).</summary>
|
||||
internal GoLiveViewModel CreateGoLiveDialog()
|
||||
{
|
||||
BroadcastForm.Load();
|
||||
var dialog = new GoLiveViewModel(() => SignInAsync(), _youtubeAuth.CurrentChannel)
|
||||
{
|
||||
StreamTitle = BroadcastForm.Title,
|
||||
StreamDescription = BroadcastForm.Description,
|
||||
};
|
||||
AppLog.Write($"Go Live dialog: title='{dialog.StreamTitle}' description={dialog.StreamDescription.Length} chars");
|
||||
return dialog;
|
||||
}
|
||||
|
||||
private void BeginGoLive(bool alsoRecord)
|
||||
{
|
||||
var dialog = CreateGoLiveDialog();
|
||||
var window = new ytLive.GoLiveWindow(dialog) { Owner = System.Windows.Application.Current.MainWindow };
|
||||
if (window.ShowDialog() != true) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user