ByteSync icon indicating copy to clipboard operation
ByteSync copied to clipboard

[feature] Create SkippedEntry model and SkipReason enum

Open paul-fresquet opened this issue 10 months ago • 0 comments

Summary

Create a SkippedEntry model class to represent filesystem entries that were encountered during inventory but excluded for various reasons. This enables tracking and reporting of filtered entries.

Background

Currently, when entries are skipped during inventory building, they are:

  • Logged at Information or Warning level
  • Not tracked in any data structure
  • Not visible to the user

This makes it difficult to understand what was excluded and why.

Proposed Model

namespace ByteSync.Models.Inventories;

public class SkippedEntry
{
    public string FullPath { get; init; } = string.Empty;
    
    public string RelativePath { get; init; } = string.Empty;
    
    public string Name { get; init; } = string.Empty;
    
    public SkipReason Reason { get; init; }
    
    public FileSystemEntryKind? DetectedKind { get; init; }
    
    public DateTime SkippedAt { get; init; } = DateTime.UtcNow;
}

Proposed Enum

namespace ByteSync.Models.Inventories;

public enum SkipReason
{
    Unknown = 0,
    
    /// <summary>Hidden file or directory (user setting)</summary>
    Hidden = 1,
    
    /// <summary>OS system file attribute (Windows)</summary>
    SystemAttribute = 2,
    
    /// <summary>Known noise file (.DS_Store, thumbs.db, etc.)</summary>
    NoiseFile = 3,
    
    /// <summary>Symbolic link</summary>
    Symlink = 4,
    
    /// <summary>POSIX special file (device, FIFO, socket)</summary>
    SpecialPosixFile = 5,
    
    /// <summary>File marked as offline (cloud placeholder)</summary>
    Offline = 6,
    
    /// <summary>Access denied or permission error</summary>
    Inaccessible = 7,
    
    /// <summary>File disappeared during scan</summary>
    NotFound = 8,
    
    /// <summary>IO error during inspection</summary>
    IoError = 9
}

Acceptance Criteria

  • [ ] Create SkippedEntry class in ByteSync.Models.Inventories
  • [ ] Create SkipReason enum in ByteSync.Models.Inventories
  • [ ] Add XML documentation for each enum value
  • [ ] Use init properties for immutability
  • [ ] Include DetectedKind to store classification when relevant
  • [ ] Unit tests for model construction

Technical Notes

  • SkippedEntry is a lightweight DTO, not persisted to inventory files
  • Used for runtime tracking and UI display
  • DetectedKind is nullable because some skip reasons (e.g., Inaccessible) occur before classification

Dependencies

  • Requires: FileSystemEntryKind enum (issue #262)

Priority

Standard — Enables transparent reporting of filtered entries.

paul-fresquet avatar Feb 01 '26 19:02 paul-fresquet