mirror of
https://github.com/Grace-Solutions/PSMinIO.git
synced 2026-07-26 14:58:13 +00:00
c77cca3f9c
� CRITICAL POWERSHELL THREADING FIX: ✅ ROOT CAUSE IDENTIFIED: • ProcessQueuedUpdates() was called from background threads (Task.Run) • PowerShell cmdlets can only call Write-Progress/Write-Verbose from main thread • Error: 'WriteObject and WriteError methods cannot be called from outside...' • Background thread progress updates caused cmdlet failures � SOLUTION IMPLEMENTED: • Removed ProcessQueuedUpdates() calls from background threads • Added periodic progress processing from main thread • Wait with 1-second intervals to process queued updates • Maintains real-time progress while respecting PowerShell threading ⚡ TECHNICAL APPROACH: • Background threads queue progress updates (thread-safe) • Main thread processes updates every 1 second during Task.WaitAll • Final processing after all tasks complete • Preserves chunk status tracking without threading violations ✅ PRESERVED FEATURES: • Chunk status tracking (Queued, Transferring, Completed, Failed) • Enhanced PartInfo with timing and error details • Chunk generation logging • Real-time progress updates (every 1 second) � RESULT: • Multipart uploads work reliably again • Progress updates every second from main thread • No PowerShell threading violations • Maintains all enhanced features safely Critical fix for PowerShell cmdlet threading compliance!