Skip to content

refactor(quickfiler): remove unused stackMovedItems parameter from MoveEmailsAsync (#629) - #734

Merged
drmoisan merged 3 commits into
mainfrom
feature/qfc-remove-stackmoveditems-parameter-629
Sep 2, 2026
Merged

drmoisan merged 3 commits into
mainfrom
feature/qfc-remove-stackmoveditems-parameter-629

Conversation

@drmoisan

@drmoisan drmoisan commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Suggested title

refactor(quickfiler): remove unused stackMovedItems parameter from MoveEmailsAsync (#629)

Summary

  • Removes the unused stackMovedItems parameter from IQfcCollectionController.MoveEmailsAsync and
    its implementation — the undo stack was never populated from this argument.
  • Updates the sole production call site (QfcFormController.EventHandlers.cs) to invoke the
    zero-argument overload.
  • Updates four tests across two files whose call shape referenced the old signature: three mechanical
    fixes, one rewrite that preserves the early-return-branch coverage the old test happened to also pin.
  • Rewrites the XML doc comment on the interface method as a <remarks> block explaining where the
    undo stack is actually populated, instead of leaving a stale <param> tag.
  • No behavioral change: this is a same-process signature simplification with an unchanged call graph.

Why

Issue #469's investigation (defect 4) established that MoveEmailsAsync's stackMovedItems parameter
is never used to populate the undo stack — EmailFiler.PushToUndoStack writes onto the same global
SloStack instance directly (UtilitiesCS/EmailIntelligence/EmailParsingSorting/EmailFiler.cs:185-189).
Issue #468's branch could not remove the parameter itself because doing so required editing
QfcFormController.EventHandlers.cs, a file outside that branch's declared scope, so it added an
explicit discard (_ = stackMovedItems;) and deferred the actual removal to this issue (#629). Leaving
a discarded, unused parameter on a production interface is a maintenance hazard: a future reader may
reasonably — and incorrectly — assume it does something.

What Changed

Core feature (production code):

  • QuickFiler/Interfaces/IQfcCollectionController.cs — Task MoveEmailsAsync(SloStack<IMovedMailInfo> stackMovedItems) → Task MoveEmailsAsync(); <param> doc replaced with a <remarks> block.
  • QuickFiler/Controllers/QfcCollectionController.cs (line 2152) — parameter removed, _ = stackMovedItems; discard deleted, stale trace-log comment updated, doc comment rewritten.
  • QuickFiler/Controllers/QfcFormController.EventHandlers.cs (line 228) — call site updated to await _groups.MoveEmailsAsync();.

Tests:

  • QuickFiler.Test/Controllers/QfcCollectionControllerDefects468MoveTests.cs — 3 call sites updated mechanically; MoveEmailsAsync_WithNullStack_BehavesIdenticallyToAnEmptyStack rewritten to MoveEmailsAsync_WithEmptyItemGroupsToMove_DoesNotThrow, keeping the early-return-branch coverage it was the only test to exercise.
  • QuickFiler.Test/Controllers/QfcFormControllerUndoHandoffTests.cs — one Moq Setup and one Verify updated to the zero-argument signature.

Docs/feature folder:

  • spec.md, user-story.md, and a new atomic plan (plan.2026-09-02T11-00.md) authored for this feature folder, which previously held only issue.md.
  • Baseline and final QA-gate evidence, a coverage-delta analysis, and this feature's policy-audit, code-review, and feature-audit artifacts.

Architecture / How It Fits Together

No architectural change. IQfcCollectionController remains a single-implementation, first-party
interface (QfcCollectionController) with a single production call site
(QfcFormController.EventHandlers.cs). The undo stack's actual population path
(EmailFiler.PushToUndoStack → Globals.AF.MovedMails) is unchanged and was never wired through this
parameter.

Verification

Completed:

  • dotnet tool run csharpier check . — exit 0, no diffs.
  • msbuild TaskMaster.sln /t:Rebuild /m /p:Configuration=Debug "/p:Platform=Any CPU" /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=true — exit 0, 0 errors.
  • msbuild TaskMaster.sln /t:Rebuild /m /p:Configuration=Debug "/p:Platform=Any CPU" /p:TreatWarningsAsErrors=true — exit 0, 0 errors.
  • Full QuickFiler.Test suite via vstest.console.exe with coverage — 6949/6949 passing, both baseline and final.
  • Coverage delta (using the reliable lines-covered/lines-valid sums, not the root Cobertura rate attributes, which are known-unreliable per open defects Bug: cobertura-package-rates-not-recomputed #529/Bug: cobertura-merged-class-methods-incomplete #530): line coverage +0.0078pp, branch coverage −0.0121pp (within run-to-run noise; no branching logic was touched by this change). Full analysis: evidence/qa-gates/p2-t6-coverage-delta.md.
  • Diff footprint verified against origin/main: exactly the 5 production/test files predicted in spec.md, plus this feature folder's own docs/evidence. evidence/other/p1-t6-footprint-check.md.

Recommended:

  • CI reproduction of the same toolchain pass and 6949/6949 test count.

Backward Compatibility / Migration Notes

Breaking change to IQfcCollectionController.MoveEmailsAsync's signature. This is not a published or
external API — it has exactly one production implementation and one production call site, both
first-party and updated in this same PR. No external consumer is affected.

Risks and Mitigations

  • Risk: a missed mock/setup site elsewhere in the test suite would fail to compile.
    Mitigation: a full-repo grep for MoveEmailsAsync and Mock<IQfcCollectionController> was run
    before editing began and found all 6 call sites (4 direct + 2 mock), one more than issue.md
    originally anticipated (evidence/baseline/p0-t8-mock-sweep.md).
  • Risk: deleting rather than rewriting the null-stack test could silently drop branch coverage on
    the early-return path.
    Mitigation: confirmed via grep this was the only test setting _itemGroupsToMove to an empty
    collection, and rewrote rather than deleted it.

Review Guide

Suggested order:

  1. QuickFiler/Interfaces/IQfcCollectionController.cs — the signature change and doc-comment rewrite.
  2. QuickFiler/Controllers/QfcCollectionController.cs — the implementation-side removal.
  3. QuickFiler/Controllers/QfcFormController.EventHandlers.cs — the one-line call-site update.
  4. QuickFiler.Test/Controllers/QfcCollectionControllerDefects468MoveTests.cs — 3 mechanical fixes plus the one rewritten test (see evidence/other/p1-t5-test-disposition.md for rationale).
  5. QuickFiler.Test/Controllers/QfcFormControllerUndoHandoffTests.cs — the two Moq site updates.
  6. The docs/features/active/2026-08-26-qfc-remove-stackmoveditems-parameter-629/ folder is documentation and evidence only; the two .cobertura.xml files are large and mechanical (raw coverage tool output), not hand-authored.

Follow-ups

None identified. This closes out the deferred cleanup that issue #468 explicitly left for a later issue.

GitHub Auto-close

drmoisan and others added 3 commits September 2, 2026 06:35
…ms removal

Fills in the feature-folder scaffold that had only issue.md populated
(spec.md/user-story.md/plan.md were unfilled templates). Removes the
stale empty plan.2026-08-30T08-15.md scaffold, replaced by a real
7-task Phase 0 / 6-task Phase 1 / 10-task Phase 2 atomic plan.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATYLDoRLKXS5sgAzegW7ZL
…veEmailsAsync (#629)

The undo stack is populated by EmailFiler.PushToUndoStack directly onto the
shared Globals.AF.MovedMails instance; the parameter was never read. Updates
the sole call site and the four tests whose call shape referenced the old
signature, rewriting one test in place to preserve its early-return-branch
coverage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATYLDoRLKXS5sgAzegW7ZL
@drmoisan
drmoisan merged commit 258ddef into main Sep 2, 2026
5 checks passed
@drmoisan
drmoisan deleted the feature/qfc-remove-stackmoveditems-parameter-629 branch September 2, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Remove the stackMovedItems parameter from MoveEmailsAsync

1 participant