Initial commit: EngineeringSync v1.0.0
Vollständige Implementierung des EngineeringSync-Middleware-Tools: - Windows Service (Kestrel :5050) mit FileSystemWatcher + SignalR - WPF Tray-App mit PendingChanges- und Projektverwaltungs-Fenster - Setup-Wizard (8-Schritte-Installer) - SQLite/EF Core Datenschicht (WAL-Modus) - SHA-256-basiertes Debouncing (2s Fenster) - Backup-System mit konfigurierbarer Aufbewahrung Bugfixes & Verbesserungen: - BUG-1: AppDbContext OnConfiguring invertierte Bedingung behoben - BUG-2: Event-Handler-Leak in TrayApp (Fenster-Singleton-Pattern) - BUG-3: ProjectConfigChanged SignalR-Signal in allen CRUD-Endpoints - BUG-5: Rename-Sync löscht alte Datei im Simulations-Ordner - BUG-6: Doppeltes Dispose von SignalR verhindert - BUG-7: Registry-Deinstallation nur EngineeringSync-Eintrag entfernt - S1: Path-Traversal-Schutz via SafeCombine() im SyncManager - E1: FSW Buffer 64KB + automatischer Re-Scan bei Overflow - E2: Retry-Logik (3x) für gesperrte Dateien mit exponentiellem Backoff - E4: Channel.Writer.TryComplete() beim Shutdown - C2: HubMethodNames-Konstanten statt Magic Strings - E3: Pagination in Changes-API (page/pageSize Query-Parameter) - A1: Fire-and-Forget mit try/catch + Logging Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
7
EngineeringSync.Domain/Constants/HubMethodNames.cs
Normal file
7
EngineeringSync.Domain/Constants/HubMethodNames.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace EngineeringSync.Domain.Constants;
|
||||
|
||||
public static class HubMethodNames
|
||||
{
|
||||
public const string ReceiveChangeNotification = "ReceiveChangeNotification";
|
||||
public const string ProjectConfigChanged = "ProjectConfigChanged";
|
||||
}
|
||||
9
EngineeringSync.Domain/EngineeringSync.Domain.csproj
Normal file
9
EngineeringSync.Domain/EngineeringSync.Domain.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
12
EngineeringSync.Domain/Entities/FileRevision.cs
Normal file
12
EngineeringSync.Domain/Entities/FileRevision.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace EngineeringSync.Domain.Entities;
|
||||
|
||||
public class FileRevision
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid ProjectId { get; set; }
|
||||
public ProjectConfig Project { get; set; } = null!;
|
||||
public string RelativePath { get; set; } = string.Empty;
|
||||
public string FileHash { get; set; } = string.Empty;
|
||||
public long Size { get; set; }
|
||||
public DateTime LastModified { get; set; }
|
||||
}
|
||||
14
EngineeringSync.Domain/Entities/PendingChange.cs
Normal file
14
EngineeringSync.Domain/Entities/PendingChange.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace EngineeringSync.Domain.Entities;
|
||||
|
||||
public class PendingChange
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid ProjectId { get; set; }
|
||||
public ProjectConfig Project { get; set; } = null!;
|
||||
public string RelativePath { get; set; } = string.Empty;
|
||||
public ChangeType ChangeType { get; set; }
|
||||
public string? OldRelativePath { get; set; }
|
||||
public ChangeStatus Status { get; set; } = ChangeStatus.Pending;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? SyncedAt { get; set; }
|
||||
}
|
||||
28
EngineeringSync.Domain/Entities/ProjectConfig.cs
Normal file
28
EngineeringSync.Domain/Entities/ProjectConfig.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace EngineeringSync.Domain.Entities;
|
||||
|
||||
public class ProjectConfig
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string EngineeringPath { get; set; } = string.Empty;
|
||||
public string SimulationPath { get; set; } = string.Empty;
|
||||
/// <summary>Komma-separiert, z.B. ".jt,.cojt,.xml"</summary>
|
||||
public string FileExtensions { get; set; } = string.Empty;
|
||||
public bool IsActive { get; set; } = true;
|
||||
public bool BackupEnabled { get; set; } = true;
|
||||
public string? BackupPath { get; set; } = null;
|
||||
public int MaxBackupsPerFile { get; set; } = 0;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public ICollection<FileRevision> FileRevisions { get; set; } = [];
|
||||
public ICollection<PendingChange> PendingChanges { get; set; } = [];
|
||||
|
||||
public IEnumerable<string> GetExtensions()
|
||||
{
|
||||
// Wenn leer oder "*" → alle Dateien beobachten
|
||||
if (string.IsNullOrWhiteSpace(FileExtensions) || FileExtensions.Trim() == "*")
|
||||
return ["*"];
|
||||
|
||||
return FileExtensions.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
}
|
||||
}
|
||||
8
EngineeringSync.Domain/Enums/ChangeStatus.cs
Normal file
8
EngineeringSync.Domain/Enums/ChangeStatus.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace EngineeringSync.Domain.Entities;
|
||||
|
||||
public enum ChangeStatus
|
||||
{
|
||||
Pending,
|
||||
Synced,
|
||||
Ignored
|
||||
}
|
||||
9
EngineeringSync.Domain/Enums/ChangeType.cs
Normal file
9
EngineeringSync.Domain/Enums/ChangeType.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace EngineeringSync.Domain.Entities;
|
||||
|
||||
public enum ChangeType
|
||||
{
|
||||
Created,
|
||||
Modified,
|
||||
Renamed,
|
||||
Deleted
|
||||
}
|
||||
Reference in New Issue
Block a user