fix temp files cleanup#122
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughA task-local temp directory is created at UploadBlob start, threaded through HandleUpload → AppendAny → GetStream and compression/re-encoding helpers for intermediate files, and removed in a finally block; changelog and project version updated. ChangesTemp Directory Centralization
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@Frends.AzureBlobStorage.UploadBlob/Frends.AzureBlobStorage.UploadBlob/UploadBlob.cs`:
- Around line 191-192: The append-flow is using input.SourceFile which can be
empty for directory-mode uploads; update all calls to AppendAny to pass the
actual file path using fi.FullName instead of input.SourceFile (e.g., replace
the argument in AppendAny(appendBlobClient, blobName, input.SourceFile,
tempDirectory, cancellationToken) and the other two occurrences so they become
AppendAny(appendBlobClient, blobName, fi.FullName, tempDirectory,
cancellationToken)), ensuring the AppendAny invocation uses fi.FullName for
append operations.
- Around line 626-631: The CleanupTempDirectory method currently calls
Directory.Delete and can throw, which may mask upload results; change
CleanupTempDirectory(string tempDirectory) to perform a best-effort delete by
catching and ignoring (or logging) any exceptions from Directory.Delete so it
never throws (do not rethrow), and ensure it still returns void; reference the
method name CleanupTempDirectory and the call to Directory.Delete when locating
the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b04fbd57-640c-4282-b7fe-e00dd1701a2a
📒 Files selected for processing (1)
Frends.AzureBlobStorage.UploadBlob/Frends.AzureBlobStorage.UploadBlob/UploadBlob.cs
| fi = await AppendAny(appendBlobClient, blobName, input.SourceFile, tempDirectory, | ||
| cancellationToken); |
There was a problem hiding this comment.
Use the current file path in append flows (directory mode bug).
Line 191, Line 266, and Line 310 pass input.SourceFile to AppendAny. In directory uploads this can be empty, causing append-on-existing paths to fail. Pass fi.FullName instead.
Suggested fix
- fi = await AppendAny(appendBlobClient, blobName, input.SourceFile, tempDirectory,
+ fi = await AppendAny(appendBlobClient, blobName, fi.FullName, tempDirectory,
cancellationToken);
- fi = await AppendAny(blobClient, blobName, input.SourceFile, tempDirectory, cancellationToken);
+ fi = await AppendAny(blobClient, blobName, fi.FullName, tempDirectory, cancellationToken);
- fi = await AppendAny(pageBlobClient, blobName, input.SourceFile, tempDirectory,
+ fi = await AppendAny(pageBlobClient, blobName, fi.FullName, tempDirectory,
cancellationToken);Also applies to: 266-266, 310-311
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@Frends.AzureBlobStorage.UploadBlob/Frends.AzureBlobStorage.UploadBlob/UploadBlob.cs`
around lines 191 - 192, The append-flow is using input.SourceFile which can be
empty for directory-mode uploads; update all calls to AppendAny to pass the
actual file path using fi.FullName instead of input.SourceFile (e.g., replace
the argument in AppendAny(appendBlobClient, blobName, input.SourceFile,
tempDirectory, cancellationToken) and the other two occurrences so they become
AppendAny(appendBlobClient, blobName, fi.FullName, tempDirectory,
cancellationToken)), ensuring the AppendAny invocation uses fi.FullName for
append operations.
MichalFrends1
left a comment
There was a problem hiding this comment.
Update project version and changelog
Review Checklist
Summary by CodeRabbit
Refactor
Fix