Skip to content

Bug: orphaned-duplicate-folderconverter-dead-file-with-always-false-guards #616

Description

@drmoisan
  • Work Mode: full-bug

Summary

UtilitiesCS/EmailIntelligence/FolderConverter.cs declares the same fully-qualified static class
name as the live UtilitiesCS/OutlookObjects/Folder/FolderConverter.cs, but it is not compiled:
UtilitiesCS/UtilitiesCS.csproj:1054 includes only the OutlookObjects file. The orphaned copy is
dead code that no build has validated, and it contains two guards that can never be true.

At line 30 it compares a value with itself, olBranchURI.Scheme != olBranchURI.Scheme, which is
always false, so the guard it protects never fires. At line 40 it evaluates
relativePath[0].Equals("."), comparing a char to a string; char.Equals(object) returns false
for a boxed string regardless of content, so that guard is also always false. Neither defect can
affect runtime today because the file is not in the compilation, which is precisely what has allowed
them to persist unnoticed.

The file is also a latent build hazard. Because it declares UtilitiesCS.FolderConverter a second
time, any change that causes it to be auto-included - most plausibly a migration of UtilitiesCS
from the current non-SDK packages.config project format to an SDK-style project, where **/*.cs
is globbed by default - turns it into a CS0101 duplicate-definition error. That failure would
appear during an unrelated migration and would be time-consuming to attribute.

Recommended resolution is deletion. The live implementation at
UtilitiesCS/OutlookObjects/Folder/FolderConverter.cs is the one under active development (it is
the subject of issue #614), and keeping a stale second copy of the same type creates an ongoing risk
that a maintainer or an agent reads or edits the wrong file. If any behavior in the orphaned copy is
judged worth keeping, it should be ported deliberately into the live file with tests rather than
retained as an uncompiled shadow.

Found during the issue #614 defect census and deliberately not absorbed into that fix, because it is
not on the #614 path-representation chain and changes nothing that #614 exercises.

Environment

  • OS/version: Windows 11 Pro 10.0.26200; .NET Framework 4.8.1; Visual Studio 18 Community MSBuild.
  • Python version: Not applicable; this is C#.
  • Command/flags used: Static inspection; confirmed against
    msbuild TaskMaster.sln /t:Rebuild /m /p:Configuration=Debug "/p:Platform=Any CPU".
  • Data source or fixture: Repository source at commit c279d40b.

Steps to Reproduce

  1. Open UtilitiesCS/EmailIntelligence/FolderConverter.cs and note it declares
    UtilitiesCS.FolderConverter.
  2. Search UtilitiesCS/UtilitiesCS.csproj for FolderConverter.cs and observe that only
    OutlookObjects\Folder\FolderConverter.cs is included (line 1054).
  3. Inspect line 30 of the orphaned file: olBranchURI.Scheme != olBranchURI.Scheme.
  4. Inspect line 40 of the orphaned file: relativePath[0].Equals(".").

Expected Behavior

The repository contains exactly one definition of UtilitiesCS.FolderConverter, and every C# file
under a project directory is either compiled or absent. Guard conditions compare distinct operands
and use type-compatible comparisons.

Actual Behavior

A second, uncompiled definition of the same type persists with two guards that are unconditionally
false. The project builds today only because the file is excluded from the compilation.

Logs / Screenshots

  • Attached minimal logs or screenshot
  • Snippet: not applicable; the defect is established by static inspection of the two cited lines and
    the project-file include list.

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

No runtime impact today. The cost is maintainer confusion and a latent CS0101 that would surface
during an SDK-style project migration.

Source

From: docs/features/potential/2026-08-26-orphaned-duplicate-folderconverter-dead-file-with-always-false-guards.md

Activity

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