Raise the upload ceiling to a true 1 MB, and guard the fallback decoder against hanging #7
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?
Follow-up to #3 and #5.
1. The ceiling was more conservative than it needed to be
The upload budget was set to 900 KB on the assumption that multipart overhead needed meaningful headroom under the 1 MB ingress cap. Measured against production, the real envelope is about 200 bytes:
413401— passed the ingress401401So 148 KB of usable room was being left on the table. The budget is now derived as
MAX_REQUEST_BYTES - 2048(1,046,528 bytes — an order of magnitude more margin than measured, enough for any realistic filename), which reads as "1.0 MB" to the user.Effect: videos up to ~1 MB now upload instead of being rejected at 0.9 MB, and photos retain slightly more resolution because the compressor has more room — the worst-case test image went from 1404×1053 to 1497×1122.
2. The fallback decoder could hang forever
decode()falls back to an<img>load whencreateImageBitmapthrows. That promise settled only ononloadoronerror; a load that did neither would leave the uploader stuck onPreparing…with nothing to time it out. Bounded at 20s now, which surfaces as a normal upload error instead of an indefinite spinner.Still not fixed by this
A large hero video (the 12 MB
ballantyne-hero-london-full.mp4) remains impossible to upload. 1 MB is the hard ingress ceiling and video cannot be re-encoded in the browser. The only real fix is raisingnginx.ingress.kubernetes.io/proxy-body-sizeon the ingress.