Skip to content

Develop debug build

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 02 Oct 18:24
· 43 commits to master since this release
Fix video upload hanging then 400ing

Root-caused against the backend's actual upload validation
(custom.upload.validation.ts): it sniffs real content from magic
bytes and only allows video/mp4 (UPLOAD_ALLOWED_MIME), returning a
"uniform 400" for anything else -- by design, per its own comment.
Three client-side problems compounded that into "waits forever, then
400":

- OkHttp read/write timeouts were 30s, far too tight for a real video
  upload over mobile data. Bumped to 5 minutes (these bound a single
  stalled read/write, not the whole request, so ordinary JSON calls
  are unaffected).
- uriToMultipart() read the entire picked file into a ByteArray before
  starting the network write -- slow and OOM-risky for a large video.
  Now streams directly from the ContentResolver InputStream via a
  custom RequestBody.
- No client-side check against the server's video/mp4-only policy, so
  a non-MP4 video (e.g. saved from another app in a different
  container) would upload in full before being rejected. Now checked
  against the picked file's declared MIME type upfront, skipping the
  doomed upload with a clear message instead of a slow round trip
  ending in "Request failed (400)".

Not ruled out: if the video was headed to Instagram specifically,
InstagramDto.post_type only accepts 'post'/'story' server-side, not a
distinct "reel" type, and we always default to 'post' for video --
possible but a JSON create-post validation failure would fail near
-instantly, not after a long wait, so the upload-side issues above are
the more likely cause of what was reported.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011m2NhJJ5EjPwvQvwjMULd5