Feature update tools for apps - #10
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the versionfiles.ps1 script to improve mutex handling, file operation reliability, and error reporting. The changes address synchronization issues and add verification steps for file writes.
Changes:
- Improved mutex initialization and acquisition logic to handle both creating and acquiring scenarios
- Added verification logic to confirm file writes complete successfully with expected content lengths
- Enhanced error handling and logging throughout the script
- Modified file update logic to only write when content actually differs
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $lock.ReleaseMutex() | ||
| log "mutex released." |
There was a problem hiding this comment.
ReleaseMutex() is called unconditionally in the try block but not protected in the finally block. If an exception occurs after successfully acquiring the mutex (lines 155-160), the mutex will be released in line 200 which won't be reached, then disposed in the finally block (line 208) without being released. This leaves the mutex in an abandoned state. Move the ReleaseMutex() call to the finally block before Dispose(), and guard it to only release if the mutex was actually acquired.
No description provided.