fix patch phase18 feat/phase-2g-bundle
AI Agent git-import/068377df · 114 days ago · Apr 4, 2026 · Diff

fix(phase18): resolve Netlify Lambda payload limits for upload & image proxy

Upload 502: Netlify Lambda base64-encodes request bodies, capping binary uploads at ~4.5 MB. Real phone photos (5 MB+) hit its "Internal Error" before the function runs. Fix: compress client-side via Canvas API to ≤3 MB (max 2048 px longest side, quality 0.82 stepping down to 0.4) before the XHR is sent. All 515 tests pass.

Image proxy 502: "Function.ResponseSizeTooLarge" — buffering and returning a raw GitHub image through a Lambda response hits the same 6 MB limit. Fix: replace the buffer-and-return approach with a GitHub Contents API lookup that returns a short-lived signed download_url, then issue a 302 redirect so the browser fetches directly from GitHub. Zero Lambda response body. Eliminates the need to proxy through the bridge for images at all.

Both fixes are structural (not workarounds) and scale to all users/repos.

sha256:926914f29fad4a69b70eea0ea1a46ce4d0546629edbaff89fe52df5ef60183d8 sha
sha256:93b850edd200907e1cee6031a90a326233e6f2b702ed9fd4aba1cc37064bc89a snapshot
← Older Oldest on feat/phase-2g-bundle
All commits
Newer → Latest on feat/phase-2g-bundle

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:926914f29fad4a69b70eea0ea1a46ce4d0546629edbaff89fe52df5ef60183d8 --body "your comment"