Skip to content

[previews] Missing-file 404 and batch route hardening#1154

Merged
frankrousseau merged 2 commits into
cgwire:mainfrom
frankrousseau:fix-missing-remote-file-404
Jul 10, 2026
Merged

[previews] Missing-file 404 and batch route hardening#1154
frankrousseau merged 2 commits into
cgwire:mainfrom
frankrousseau:fix-missing-remote-file-404

Conversation

@frankrousseau

@frankrousseau frankrousseau commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Problems

  • On S3/Swift backends, a download that reported success but produced an empty or missing file raised an uncaught DownloadFromStorageFailedException, so preview/thumbnail requests 500ed.
  • The batch delete-entities route fetched every entity in its authorization loop and in remove_entities, so an id already deleted by someone else raised EntityNotFoundException and failed the whole batch.

Solutions

  • Raise FileNotFound (404) instead, matching the local backend; the now-unused exception class is removed.
  • Skip absent entities in both loops, keeping the deletion idempotent like remove_tasks.

@frankrousseau frankrousseau changed the title [previews] Return 404 for a missing remote preview file [previews] Missing-file 404 and batch route hardening Jul 10, 2026
@frankrousseau
frankrousseau force-pushed the fix-missing-remote-file-404 branch from 16cd418 to f61d646 Compare July 10, 2026 12:23
frankrousseau and others added 2 commits July 10, 2026 14:35
On S3/Swift backends, a download that reported success but produced an
empty or missing file raised DownloadFromStorageFailedException, which no
handler caught, so preview/thumbnail requests 500ed. Raise FileNotFound
instead, matching the local backend and the existing not-found handling
that returns 404. The now-unused exception class is removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The batch delete-entities route fetched every entity in both the
authorization loop and remove_entities, so an id already deleted by
someone else raised EntityNotFoundException and failed the whole batch.
Skip absent entities in both loops: the deletion is idempotent and
mirrors remove_tasks, which ignores unknown ids.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@frankrousseau
frankrousseau force-pushed the fix-missing-remote-file-404 branch from f61d646 to 570eb6d Compare July 10, 2026 12:37
@frankrousseau
frankrousseau merged commit d42543f into cgwire:main Jul 10, 2026
2 checks passed
@frankrousseau
frankrousseau deleted the fix-missing-remote-file-404 branch July 10, 2026 12:46
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