Files
PSMinIO/Module
PSMinIO Developer c77cca3f9c Fix PowerShell threading issue in multipart upload progress
� 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!
2025-07-14 22:19:13 -04:00
..