Skip to content

Bug: quickfiler-session-metrics-twelve-hour-time-format #645

Description

@drmoisan
  • Work Mode: full-bug

Summary

The QuickFiler session-metrics CSV renders its time-of-day field with the .NET format string
"hh:mm". Lowercase hh is the 12-hour clock, and the format carries no tt designator, so 14:30
renders as 02:30 and is indistinguishable from 02:30. Every row written since the format was
introduced carries an ambiguous time.

Three sites are affected, all in QuickFiler:

  • QuickFiler/Controllers/QfcHomeController.Metrics.cs:31
  • QuickFiler/Controllers/QfcHomeController.Metrics.cs:110
  • QuickFiler/Controllers/EfcHomeController.Metrics.cs:68

Line numbers are as of the spec that raised this note; they shift slightly after the metrics work
described below.

Why this was split out rather than fixed alongside the metrics work. This was identified as
cross-feature note CFN-4 while delivering issues #442, #443 and #451 (feature
quickfiler-home-controller-metrics-442). It was deliberately excluded from that scope for three
reasons: it is a content defect whereas that feature's remit was the row shape, the flush, and
duration correctness; fixing it breaks three currently passing tests on their asserted literals
(QuickFiler.Test/Controllers/QfcHomeControllerMetricsTests.cs, two clock-seam tests, and
QuickFiler.Test/Controllers/EfcHomeControllerMetricsTests.cs, the formatted-row test), each of
which encodes the 12-hour rendering; and no issue in that family lists it as an acceptance
criterion. The sibling numeric-format defect at the same sites was fixed there: the six numeric
format calls now pass CultureInfo.InvariantCulture. The date and time format calls were left
untouched precisely so this defect could be tracked separately.

Proposed fix. Change the three format strings from "hh:mm" to "HH:mm" (24-hour) and update
the three asserted test literals to match. "HH:mm" is preferred over "hh:mm tt" because the
adjacent SentDate field already renders as "HH:mm:ss", so 24-hour is the file's existing
convention and keeps the row internally consistent. Consider passing CultureInfo.InvariantCulture
to these calls at the same time, matching what the numeric fields now do.

Backward compatibility. The session-metrics CSV has no in-repo reader: a repository-wide search
for EmailSession returns three settings-plumbing declarations and three writers, and no parser or
schema consumer. The artifact is write-only from the codebase's perspective. The residual risk is
confined to a human-maintained spreadsheet outside the repository.

Environment

  • OS/version: Windows 11, Outlook VSTO add-in host
  • Python version: not applicable (C# / .NET Framework 4.8)
  • Command/flags used: msbuild TaskMaster.sln /t:Rebuild /m /p:Configuration=Debug "/p:Platform=Any CPU"
  • Data source or fixture: the session-metrics CSV emitted by the QuickFiler and EFC metrics writers

Steps to Reproduce

  1. Run a QuickFiler filing session, or an EFC move session, whose metrics write occurs at any
    time of day at or after 13:00 local time.
  2. Open the session-metrics CSV that the run appends to.
  3. Read the time-of-day field of the appended row.

Expected Behavior

The time-of-day field unambiguously identifies the hour, either on a 24-hour clock (14:30) or on a
12-hour clock with an explicit AM/PM designator (02:30 PM).

Actual Behavior

The field renders 02:30 for a 14:30 event. No AM/PM designator is present, so an afternoon row is
byte-identical to a small-hours row and the recorded time cannot be recovered from the file.

Logs / Screenshots

  • Attached minimal logs or snippet
  • Snippet: the three offending format strings are the literal "hh:mm" at
    QuickFiler/Controllers/QfcHomeController.Metrics.cs:31 and :110, and
    QuickFiler/Controllers/EfcHomeController.Metrics.cs:68.

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Medium: the emitted data is silently wrong rather than absent, and the file has no in-repo reader,
so nothing in the product misbehaves. The cost is borne by whoever analyses the CSV outside the
repository.

Source

From: docs/features/potential/2026-08-27-quickfiler-session-metrics-twelve-hour-time-format.md

Activity

  1. drmoisan commented on Aug 27, 2026

    @drmoisan
    OwnerAuthor

    Scope widening request: the date and time separators are culture-sensitive too

    This issue was filed for the 12-hour "hh:mm" format string. Feature review of
    quickfiler-home-controller-metrics-442 (finding CR-3) identified a second, adjacent defect at the
    same sites, and recommends resolving the whole timestamp-content question here rather than in a
    separate issue.

    The additional defect

    In .NET custom date and time format strings, / and : are not literals. / is the date
    separator
    placeholder and : is the time separator placeholder, and both resolve against
    CultureInfo.CurrentCulture. None of the date/time format calls in the two metrics files passes
    CultureInfo.InvariantCulture, so under a locale such as de-DE:

    • SentDate.ToString("MM/dd/yyyy") renders 06.30.2026, not 06/30/2026
    • the time field's : likewise becomes the locale's time separator

    Affected sites, as of bug/quickfiler-home-controller-metrics-442 at 6a1b9ca4:

    • QuickFiler/Controllers/QfcHomeController.Metrics.cs:48
    • QuickFiler/Controllers/QfcHomeController.Metrics.cs:125-127
    • QuickFiler/Controllers/EfcHomeController.Metrics.cs:120-121

    Why it was not fixed in #442 / #443 / #451

    That feature's AC-16 deliberately scoped culture invariance to the six numeric format sites,
    because a locale-dependent decimal separator changes 2.00 to 2,00 and therefore changes the CSV
    field count — a shape defect. The date and time separators cannot introduce a comma, so they cannot
    change the field count; they are a content defect, which is the same classification that put the
    "hh:mm" problem into this issue rather than into that feature. The six numeric sites now pass
    CultureInfo.InvariantCulture; the date and time calls were left untouched precisely so they could
    be dealt with together, here.

    Suggested combined remedy

    1. "hh:mm" becomes "HH:mm" (the original ask): 24-hour, consistent with the adjacent SentDate
      field's existing "HH:mm:ss".
    2. Every date and time ToString call in QfcHomeController.Metrics.cs and
      EfcHomeController.Metrics.cs also passes CultureInfo.InvariantCulture, matching what the six
      numeric sites now do.
    3. Update the three affected asserted test literals in
      QuickFiler.Test/Controllers/QfcHomeControllerMetricsTests.cs and
      QuickFiler.Test/Controllers/EfcHomeControllerMetricsTests.cs.
    4. Add a de-DE culture test asserting the rendered date and time fields, in the try/finally
      culture-restoring form the two existing German-culture tests already use
      (BuildQuickFileMetricLines_UnderGermanCulture_RendersInvariantDecimalSeparator and
      WriteMetricsAsync_UnderGermanCulture_RendersInvariantDecimalSeparator). Those tests currently
      assert only the decimal separator; extending the assertion to the date and time fields is the
      cheapest way to pin all of this at once.

    Doing 1 and 2 in one change costs one extra argument per call site and avoids revisiting the same
    three files twice.

    Provenance

    Finding CR-3 of
    docs/features/active/quickfiler-home-controller-metrics-442/code-review.2026-08-27T14-35.md.
    Related follow-ups opened from the same review: #646 (QFC metrics flush writes an empty session
    file) and #647 (FileIO2.WriteTextFileAsync reports success on final failure).

  2. drmoisan commented on Sep 6, 2026

    @drmoisan
    OwnerAuthor

    Delivered by #755 (merged 2026-09-03, merge commit 495b012).

    Verification on main (2026-09-06):

    • All 10 acceptance criteria in docs/features/active/quickfiler-session-metrics-twelve-hour-time-format-645/spec.md are checked.
    • Final feature audit (evidence/qa-gates/feature-audit.2026-09-03T13-00.md): no blocking findings, ready to merge.
    • QuickFiler/Controllers/QfcHomeController.Metrics.cs:127 and QuickFiler/Controllers/EfcHomeController.Metrics.cs:96 render the time-of-day field as HH:mm; no live "hh:mm" format string remains.

    Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions