fix(steam): roll back failed proxy preparation - #304
Conversation
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| { | ||
| var backupStagingPath = CreateTemporaryPath(_backupPath); | ||
| _temporaryFiles.Add(backupStagingPath); | ||
| File.Copy(_targetExePath, backupStagingPath, overwrite: false); |
There was a problem hiding this comment.
CRITICAL: Missing file existence check before copying target executable
The code attempts to copy _targetExePath without checking if it exists. This can fail when the target executable doesn't exist but the backup file does (e.g., after previous proxy deployment).
The validation in PrepareForProfileAsync (line 129) allows this scenario, so File.Copy(_targetExePath, backupStagingPath, overwrite: false) at line 544 will throw FileNotFoundException if _targetExePath doesn't exist.
| File.Copy(_targetExePath, backupStagingPath, overwrite: false); | |
| if (!File.Exists(_backupPath)) | |
| { | |
| var backupStagingPath = CreateTemporaryPath(_backupPath); | |
| _temporaryFiles.Add(backupStagingPath); | |
| if (_targetInitiallyExisted) | |
| { | |
| File.Copy(_targetExePath, backupStagingPath, overwrite: false); | |
| File.Move(backupStagingPath, _backupPath, overwrite: false); | |
| _temporaryFiles.Remove(backupStagingPath); | |
| _backupCreated = true; | |
| } | |
| } |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous Review Summaries (2 snapshots, latest commit 99a3b69)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 99a3b69)Status: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous review (commit 2ad21f2)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (2 files)
Reviewed by glm-4.7 · Input: 56.1K · Output: 6.2K · Cached: 343.6K |
Summary
Prevent failed Steam proxy preparation from leaving the proxy installed.
Changes
Testing
Risks and rollback
Process termination can bypass managed rollback. File locks or concurrent changes may prevent restoration; recovery files are retained and reported.
Related issues
Fixes #303
Greptile Summary
Prevents failed Steam proxy preparation from leaving installation mutations behind.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains; the previously reported installation serialization, filesystem-alias, and stale-backup issues are addressed by the current locking and verification paths.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Steam profile launch] --> B[Canonicalize installation path] B --> C[Acquire installation launch lock] C --> D[Verify and clean prior proxy state] D --> E[Validate workspace and filesystem prerequisites] E --> F[Capture original files and executable] F --> G[Deploy proxy and write configuration] G --> H{Preparation succeeds?} H -->|Yes| I[Commit prepared state] H -->|No or canceled| J[Roll back current mutations] J --> K{Safe restoration possible?} K -->|Yes| L[Restore original state] K -->|No| M[Retain recovery files and report conflict]Reviews (3): Last reviewed commit: "fix(steam): canonicalize installation lo..." | Re-trigger Greptile
Context used: