Moved temporary files into a folder of their own below the data directory (#1245)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-29 18:45:34 +01:00
1 parent ddfc632b63
commit 12d3e1ec6c
52 files changed
+1219 -396

No files matched your search

@@ -143,6 +143,8 @@ public partial class VisualBriefingAssistant : MSGComponentBase
/// </summary>
protected override async Task OnInitializedAsync()
{
// Taken before the first await: Blazor may dispose the page meanwhile, see "Loops of a component" in app/AGENTS.md:
var sourceMonitorToken = this.sourceMonitorCancellation.Token;
await base.OnInitializedAsync();
if (!this.SettingsManager.IsAssistantVisible(
ComponentKind.VISUAL_BRIEFING_ASSISTANT,
@@ -158,7 +160,10 @@ public partial class VisualBriefingAssistant : MSGComponentBase
this.BuildProgressService.Changed += this.BuildProgressChanged;
await this.ReloadListAsync();
await this.ConsumePendingMediaOutcomesAsync();
this.MonitorSourceStatusAsync(this.sourceMonitorCancellation.Token).Observe($"{nameof(VisualBriefingAssistant)}: monitoring the source status");
if (sourceMonitorToken.IsCancellationRequested)
return;
this.MonitorSourceStatusAsync(sourceMonitorToken).Observe($"{nameof(VisualBriefingAssistant)}: monitoring the source status");
if (AssistantLaunchService.TakeTextPayload(ComponentKind.VISUAL_BRIEFING_ASSISTANT) is { } textLaunchPayload && !string.IsNullOrWhiteSpace(textLaunchPayload.Text))
{
// A text sent here starts a briefing of its own, which holds what the text demands. The briefing
@@ -55,8 +55,11 @@ public partial class VisualBriefingBuildProgress : MSGComponentBase
protected override async Task OnInitializedAsync()
{
// Taken before the first await: Blazor may dispose the component meanwhile, see "Loops of a component" in app/AGENTS.md:
var durationMonitorToken = this.durationMonitorCancellation.Token;
await base.OnInitializedAsync();
this.MonitorBuildDurationAsync(this.durationMonitorCancellation.Token).Observe($"{nameof(VisualBriefingBuildProgress)}: monitoring the build duration");
if (!durationMonitorToken.IsCancellationRequested)
this.MonitorBuildDurationAsync(durationMonitorToken).Observe($"{nameof(VisualBriefingBuildProgress)}: monitoring the build duration");
}
protected override void OnParametersSet()
@@ -21,9 +21,8 @@ internal sealed class VisualBriefingSourcePreparationService(VisualBriefingStore
/// <returns>The prepared sources.</returns>
public async Task<VisualBriefingPreparedSources> PrepareAsync(VisualBriefingManifest manifest, Guid operationId, Guid buildId, CancellationToken token)
{
var temporaryDirectory = Path.Combine(Path.GetTempPath(), $"mwai-visual-briefing-{Guid.NewGuid():N}");
Directory.CreateDirectory(temporaryDirectory);
var temporaryDirectory = TemporaryFiles.CreateDirectory();
try
{
List<FileAttachment> attachments = [];