Skip to content

Bug: qfcqueue-enqueue-path-lacks-injectable-seams #871

Description

@drmoisan
  • Work Mode: full-bug

Summary

QfcQueue.EnqueueAsync (0 of 46 lines covered) and QfcQueue.LoadControllersViewersAsync (0 of 24 lines covered) drive a live WinForms TableLayoutPanel, per-row ItemViewer construction, UI idle-call marshalling, and the EmailMoveMonitor hook through private members with no injectable seam, so their control flow cannot be unit-tested without a live Outlook window. Item #678 left its acceptance criterion AC20 unchecked for this reason and issue #727 sub-finding 4 recorded it as a policy gap. The maintainer decision recorded on #727 on 2026-09-11 is that the resolution is a seam, not a coverage exemption.

Environment

Steps to Reproduce

  1. Search QuickFiler.Test for EnqueueAsync: zero references across QfcQueueTests.cs, QfcQueuePurePathsTests.cs, and QfcQueueCoverageExpansionTests.cs.
  2. Read QfcQueue.Enqueue.cs:71-138. EnqueueAsync calls _moveMonitor.HookItem on a field initialised inline to new EmailMoveMonitor() (QfcQueue.cs:42), clones _tlpTemplate through UiIdleCallAsync, and awaits LoadControllersViewersAsync through UiIdleAsyncCallAsync.
  3. Read QfcQueue.Enqueue.cs:154-198. LoadControllersViewersAsync calls AddAsync (QfcQueue.cs:264), which constructs a viewer and adds it to the TableLayoutPanel on the UI idle path. Only the item-controller construction that follows is behind a seam (ItemControllerFactory, added by Bug: quickfiler-carry-folder-predictor-to-item-controller #678).
  4. Attempt to write an MSTest that exercises either member: construction of the real TableLayoutPanel, the real ItemViewer, and the real EmailMoveMonitor requires a message pump and Outlook COM objects, which unit-test policy prohibits.

Expected Behavior

Both members accept mocks for every boundary they drive, following the injectable-delegate pattern already used for ItemControllerFactory (form 2 of the DI seam guidance in .claude/rules/csharp.md): the move-monitor hook, the template clone and viewer/row construction performed by AddAsync, and the UI idle-call marshalling. Tests then cover the argument-guard branches, the _jobsRunning increment and decrement, the OperationCanceledException and general-exception catch paths, the CollectionChanged raise in finally, the digits computation, and the carrier resolution per row, without a live WinForms viewer or Outlook process. Both members reach the 90% new-code floor as written.

Actual Behavior

Neither member is reachable from a unit test. The production defaults are constructed inline from private fields, so no test can substitute them. Coverage on both members is 0%, and item #678's AC20 remains unchecked.

Logs / Screenshots

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Medium: no incorrect production behavior. Two members on the high-confidence display path carry zero test coverage, and every future change to them is unverifiable by the unit suite.

Source

From: docs/features/potential/2026-09-11-qfcqueue-enqueue-path-lacks-injectable-seams.md

Activity

  1. added a commit that references this issue on Sep 13, 2026
  2. drmoisan commented on Sep 13, 2026

    @drmoisan
    OwnerAuthor

    Delivered by PR #883, merged as 10cf351.

    QfcQueue.Enqueue.cs coverage 0.152941 to 1.000000; new-code 0.958333; QfcQueue.cs reduced 507 to 269 lines; no coverage exclusions introduced; 1423/1423 tests passing.

    Merged at 21/22 acceptance criteria. AC22 is deliberately left unchecked and disclosed in the PR body: its substantive requirement is met (no untouched production or test file was modified), but its Write Set enumeration is incomplete because the branch carries tracked .claude/agent-memory/ files. AC22 as written is unsatisfiable by any agent-executed change in this repository; that criterion defect is tracked as #885.

    Closed manually because the PR carried no closing keyword. That was intentional: the context bundle had harvested seven unrelated issue numbers from prose, and emitting them as closing keywords would have closed unrelated issues. Tracked as #886.

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