mirror of
https://github.com/rehan-remade/universal-modder.git
synced 2026-11-05 01:37:40 +00:00
[PR #99] [MERGED] fix(fal): upload local files through fal's CDN token route #123
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rehan-remade/universal-modder#123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/rehan-remade/universal-modder/pull/99
Author: @AltDoug
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @rehan-remade
Base:
main← Head:fix/fal-upload-cdn-v3📝 Commits (1)
da49b6dfix(fal): upload local files through fal's CDN token route📊 Changes
2 files changed (+56 additions, -8 deletions)
View changed files
📝
tests/test_um.py(+36 -0)📝
um/fal.py(+20 -8)📄 Description
Every local-file input to
um fal(@file.png,--ref,um fal upload) currently starts with:storage/upload/initiate?storage_type=gcsno longer accepts that storage type. Files under 8 MiB still work through the data-URI fallback, but the error line shows up in every log and looks like a failure. Files over 8 MiB re-raise and exit 1 with nothing after that 400, so a 9 MB video input just stops.Fix: upload the way fal-client does now (its default "fal_v3" repository):
POST rest.fal.ai/storage/auth/token?storage_type=fal-cdn-v3for a short-lived token, thenPOST v3.fal.media/files/uploadwith the bytes, returningaccess_url. The data-URI fallback stays for small files, now with a one-line note. A big file that can't be uploaded now says why and names the 8 MiB limit instead of exiting silently. Files over ~100 MB would need fal's multipart route; that's not in this PR.Tests: new
test_upload_uses_cdn_token_and_explains_big_failures(fails before, passes after); full suite 59 passed on Windows 11, Python 3.12. Live against fal: a 2 KB and a 9,000,000 B file both upload with no 400, and the 9 MB one downloads back byte-identical (cmp).Found and fixed with AI assistance (Claude Code); the repro and the fix were run by hand on Windows 11.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.