Skip to content

fix: deletion when blob not found - #3860

Merged
beastoin merged 2 commits into
BasedHardware:mainfrom
khangkontum:fix/blob-deletion-raise
Dec 25, 2025
Merged

beastoin merged 2 commits into
BasedHardware:mainfrom
khangkontum:fix/blob-deletion-raise

Conversation

@khangkontum

Copy link
Copy Markdown
Contributor
  • Safe skip deletion when blob not found

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses a potential crash when trying to delete a blob that does not exist. The added try...except block makes the delete_syncing_temporal_file function more resilient. My review includes a suggestion to add logging to avoid silently ignoring potentially critical errors, such as a missing bucket. To further improve robustness across the codebase, I recommend auditing other functions in backend/utils/other/storage.py for similar unprotected blob.delete() calls. For example, delete_postprocessing_audio and delete_app_logo could benefit from the same error handling pattern.

Comment on lines +236 to +239
try:
blob.delete()
except BlobNotFound:
pass

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This try...except block correctly handles a missing blob, but it will also silently suppress a NotFound error if the entire bucket (syncing_local_bucket) does not exist. A missing bucket is a significant configuration error that should likely not be ignored, as it could mask underlying infrastructure problems. At a minimum, logging the error would provide visibility into why the deletion was skipped.

Suggested change
try:
blob.delete()
except BlobNotFound:
pass
try:
blob.delete()
except BlobNotFound as e:
print(f"INFO: Blob deletion skipped for {file_path}: {e}")

@beastoin
beastoin merged commit a811cc7 into BasedHardware:main Dec 25, 2025
@beastoin

Copy link
Copy Markdown
Collaborator

lgtm @khangkontum

@khangkontum
khangkontum deleted the fix/blob-deletion-raise branch December 29, 2025 22:44
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
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