milestone patch v3.0.1 - a6
6. UI Status Bar Scope Isolation
File: tools/MyBookTools.GUI.ps1
Issue: The WPF GUI status bar permanently reads "Idle" even when long-running tasks are active.
Root Cause: The UI action buttons utilize Start-Job, which spawns isolated powershell.exe worker processes. Module variables like $Script:MyBook_Status updated in the background job do not serialize back to the main UI thread's memory space.
Resolution:
Replace Start-Job with the built-in Run-InBackground runspace factory implementation and inject a synchronized hashtable ([hashtable]::Synchronized(@{})) to safely marshal status variables between the main UI thread and the background worker space, or dump the status payload to a local temporary .json file that the UI timer polls.
milestone patch v3.0.1 - a6
6. UI Status Bar Scope Isolation
File:
tools/MyBookTools.GUI.ps1Issue: The WPF GUI status bar permanently reads "Idle" even when long-running tasks are active.
Root Cause: The UI action buttons utilize
Start-Job, which spawns isolatedpowershell.exeworker processes. Module variables like$Script:MyBook_Statusupdated in the background job do not serialize back to the main UI thread's memory space.Resolution:
Replace
Start-Jobwith the built-inRun-InBackgroundrunspace factory implementation and inject a synchronized hashtable ([hashtable]::Synchronized(@{})) to safely marshal status variables between the main UI thread and the background worker space, or dump the status payload to a local temporary.jsonfile that the UI timer polls.