Summary
QfcHomeController.WriteMetricsAsync invokes the injected MetricsFileWriter unconditionally, even
when the null-and-whitespace filter leaves the diagnostic-line array empty. The default writer
FileIO2.WriteTextFileAsync opens an append StreamWriter, so a QuickFiler session that produces no
diagnostic lines now creates, or touches, a zero-content session-metrics file.
The EFC sibling path already guards against this. EfcHomeController.Metrics.cs returns early:
if (dataLines.Length == 0)
{
return;
}
QfcHomeController.Metrics.cs has no matching guard at the point where it awaits the writer.
This is a narrow regression introduced by the #442 flush fix, not a pre-existing defect. Before
that fix the QFC metrics queue was never drained, so nothing was ever written and the empty-array
case could not manifest. Making the flush work made it reachable.
The remedy is one guard in an owned file, mirroring the EFC form:
if (lines.Length == 0)
{
return;
}
It was deliberately not applied inside feature quickfiler-home-controller-metrics-442. That
feature's plan was complete and its toolchain green at the time the finding was raised by
feature-review (finding CR-1, Minor, non-blocking), and the repository's General Code Change Policy
directs opening a new issue rather than widening the scope of work in flight.
Environment
- OS/version: Windows 11, Outlook VSTO add-in host
- Python version: not applicable (C# / .NET Framework 4.8)
- Command/flags used:
vstest.console.exe QuickFiler.Test\bin\Debug\QuickFiler.Test.dll
- Data source or fixture: the session-metrics CSV in the user's
MyDocuments folder
Steps to Reproduce
- Run a QuickFiler filing session in which
GetMoveDiagnostics returns an array whose every
element is null or whitespace - for example a session in which no item is actually moved.
- Let the session reach its metrics write.
- Inspect the session-metrics file in
MyDocuments.
Expected Behavior
No write occurs and no file is created or touched, because there is no diagnostic content to record.
This matches the EFC path's behavior for the same input.
Actual Behavior
MetricsFileWriter is invoked with an empty array. The default writer opens the target for append,
so the file is created if absent and its last-write timestamp is updated if present, in both cases
recording nothing.
Logs / Screenshots
Impact / Severity
Low. The worst outcome is a spurious empty or unchanged-content file in the user's MyDocuments
folder. No data is lost, no exception is raised, and no downstream consumer exists - the
session-metrics CSV has no in-repo reader.
Source
From: docs/features/potential/2026-08-27-qfc-metrics-flush-writes-empty-session-file.md
Summary
QfcHomeController.WriteMetricsAsyncinvokes the injectedMetricsFileWriterunconditionally, evenwhen the null-and-whitespace filter leaves the diagnostic-line array empty. The default writer
FileIO2.WriteTextFileAsyncopens an appendStreamWriter, so a QuickFiler session that produces nodiagnostic lines now creates, or touches, a zero-content session-metrics file.
The EFC sibling path already guards against this.
EfcHomeController.Metrics.csreturns early:QfcHomeController.Metrics.cshas no matching guard at the point where it awaits the writer.This is a narrow regression introduced by the #442 flush fix, not a pre-existing defect. Before
that fix the QFC metrics queue was never drained, so nothing was ever written and the empty-array
case could not manifest. Making the flush work made it reachable.
The remedy is one guard in an owned file, mirroring the EFC form:
It was deliberately not applied inside feature
quickfiler-home-controller-metrics-442. Thatfeature's plan was complete and its toolchain green at the time the finding was raised by
feature-review (finding CR-1, Minor, non-blocking), and the repository's General Code Change Policy
directs opening a new issue rather than widening the scope of work in flight.
Environment
vstest.console.exe QuickFiler.Test\bin\Debug\QuickFiler.Test.dllMyDocumentsfolderSteps to Reproduce
GetMoveDiagnosticsreturns an array whose everyelement is
nullor whitespace - for example a session in which no item is actually moved.MyDocuments.Expected Behavior
No write occurs and no file is created or touched, because there is no diagnostic content to record.
This matches the EFC path's behavior for the same input.
Actual Behavior
MetricsFileWriteris invoked with an empty array. The default writer opens the target for append,so the file is created if absent and its last-write timestamp is updated if present, in both cases
recording nothing.
Logs / Screenshots
WriteMetricsAsync:await MetricsFileWriter(filename, lines, myDocuments, CancellationToken.None);reached whatever the length of
lines.Impact / Severity
Low. The worst outcome is a spurious empty or unchanged-content file in the user's
MyDocumentsfolder. No data is lost, no exception is raised, and no downstream consumer exists - the
session-metrics CSV has no in-repo reader.
Source
From: docs/features/potential/2026-08-27-qfc-metrics-flush-writes-empty-session-file.md