Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

The temporary zip file created during upload could leak if errors occurred after creation but before the cleanup step (e.g., upload failure, job submission failure).

Changes:

  • Wrapped upload/job submission in try-finally block
  • Moved cleanup to finally block with existence check
  • Ensures cleanup happens regardless of success/failure path

Before:

await createZip({...})
// ... upload and process
fs.unlinkSync(tmpZipFile)  // Only runs if no errors above

After:

await createZip({...})
try {
  // ... upload and process
  return jobs
} finally {
  if (fs.existsSync(tmpZipFile)) {
    fs.unlinkSync(tmpZipFile)
  }
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: madebydavid <5401249+madebydavid@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on progress tracking for zipping feature Ensure temp zip file cleanup with try-finally pattern Jan 22, 2026
Copilot AI requested a review from madebydavid January 22, 2026 11:55
@madebydavid
Copy link
Member

Not merging - cleanup was changed

@madebydavid madebydavid deleted the copilot/sub-pr-139 branch January 22, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants