Skip to content

minor: fix image upload cleanup refs#3228

Merged
david-crespo merged 1 commit into
mainfrom
image-cleanup-refs
May 23, 2026
Merged

minor: fix image upload cleanup refs#3228
david-crespo merged 1 commit into
mainfrom
image-cleanup-refs

Conversation

@david-crespo
Copy link
Copy Markdown
Collaborator

@david-crespo david-crespo commented May 22, 2026

A small bug the robot caught while looking at #3222.

At the end of a successful image upload, we delete the temporary snapshot and disk. If snapshot deletion succeeded but disk deletion failed, the catch path called cleanup() while snapshot.current still pointed at the already-deleted snapshot. Cleanup would then try to delete that snapshot again, fail with 404, and never reach the remaining disk cleanup.

Fix: Clear each ref immediately after its successful delete so later cleanup only retries resources that still exist.

It would be nice to have a test for this but it would be pretty elaborate for little gain.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview May 22, 2026 10:30pm

Request Review

@david-crespo david-crespo merged commit 576ce52 into main May 23, 2026
7 checks passed
@david-crespo david-crespo deleted the image-cleanup-refs branch May 23, 2026 00:12
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.

1 participant