When sessions are enabled, you can sometimes periodically see the following error in the terminal/logs:
Date: 2024-10-06 15:20:00
Level: Error
ThreadId: 0
Server: DESKTOP-900K9L3
Category: OperationStopped: (:) [Invoke-PodeScriptBlock], InvalidOperationException
Message: Collection was modified; enumeration operation may not execute.
StackTrace: at <ScriptBlock>, C:\...\PowerShell\Modules\Pode\2.11.0\Private\Sessions.ps1: line 293
at Invoke-PodeScriptBlock, C:\...\PowerShell\Modules\Pode\2.11.0\Public\Utilities.ps1: line 573
at <ScriptBlock>, <No file>: line 57
This is being thrown by the following line, and the Keys needs a .Clone() adding:
foreach ($key in $store.Memory.Keys) {
Note: This isn't a new error, my guess is this has been occurring for a long time. With the added error handling and better visibility for Schedules added in 2.11.0 this is why it's cropping up now.
Describe the Bug
When sessions are enabled, you can sometimes periodically see the following error in the terminal/logs:
This is being thrown by the following line, and the
Keys
needs a.Clone()
adding:Note: This isn't a new error, my guess is this has been occurring for a long time. With the added error handling and better visibility for Schedules added in 2.11.0 this is why it's cropping up now.
Platform