fix: resolve memory leaks, fix NuGet vulnerability, and add ANALYSIS.md - #5
Conversation
- Added explicit dependencies in XTSPrimeMoverProject.csproj to SQLitePCLRaw 2.1.12 to resolve a high-severity vulnerability (GHSA-2m69-gcr7-jv3q). - Fixed memory leak in XTSSimulationEngine.SyncPartHistoryLogs by removing keys from _partHistoryLogIndex when parts are no longer active. - Fixed memory leak in ErrorHandlingService.ReportError by periodically cleaning up expired keys from _throttleTracker. - Added ANALYSIS.md detailing these issues, other architectural considerations, and a list of missing tests. Co-authored-by: anoop6543 <21349508+anoop6543@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
This PR addresses long-running stability and security concerns in the WPF simulation by pinning vulnerable SQLite transitive dependencies, preventing unbounded in-memory tracking growth in the simulation engine and error throttling, and adding an analysis write-up for follow-on improvements/tests.
Changes:
- Pin
SQLitePCLRaw*packages to2.1.12(and enable Windows targeting) to mitigate a reported high-severity NuGet vulnerability. - Prevent unbounded growth of
_partHistoryLogIndexinXTSSimulationEngine.SyncPartHistoryLogsby removing entries for inactive parts. - Add periodic cleanup of
ErrorHandlingService’s_throttleTrackerand document findings inANALYSIS.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| XTSPrimeMoverProject.csproj | Enables Windows targeting and pins SQLitePCLRaw dependencies to address the vulnerability. |
| Services/XTSSimulationEngine.cs | Cleans up per-part history log index entries for inactive parts to prevent growth over time. |
| Services/ErrorHandlingService.cs | Adds throttle-tracker cleanup logic to prevent unbounded key accumulation. |
| ANALYSIS.md | Documents identified issues, fixes applied, and a backlog of missing tests/improvements. |
| private DateTime _lastThrottleCleanup = DateTime.UtcNow; | ||
| private static readonly TimeSpan ThrottleCleanupInterval = TimeSpan.FromMinutes(1); | ||
|
|
This pull request addresses several issues discovered during the analysis of the XTSPrimeMoverProject.
SQLitePCLRawtransitive dependencies from2.1.11to2.1.12to resolve a high-severity vulnerability (GHSA-2m69-gcr7-jv3q) related toMicrosoft.Data.Sqlite10.0.0.XTSSimulationEngineaccumulated part history entries in the_partHistoryLogIndexindefinitely. This has been resolved by implementing cleanup logic to remove tracking data for inactive parts.ErrorHandlingServiceused a_throttleTrackerto prevent redundant error reporting. The keys were highly variable (including the error message) and never cleared. A periodic cleanup process (running every minute) has been added to remove entries older than theThrottleWindowlimit.ANALYSIS.mddocument has been added to the root directory outlining the identified issues, suggested improvements, and a list of missing test cases.PR created automatically by Jules for task 16821860376610928856 started by @anoop6543