feat(video): raise video-path size limit to 1.5 GiB (#145)

The 100 MB cap that re-routed larger videos to the file-upload pipeline
was a workaround for the width/height=0 → 已过期 bug (fixed in the prior
commit), not a real QQ size limit. Real-machine verified on tempserver:
88 MB / 149 MB / 299 MB / 497 MB videos all upload, render and play as
normal videos in a group. Raise MAX_VIDEO_SIZE to 1.5 GiB (matching the
file-upload ceiling); only videos above that still fall back to the file
path. Collapse the redundant MAX_VIDEO_SIZE_HARD (was also 1.5 GiB) into
the single constant and drop the now-dead 100 MB warn branches.

Note: the whole video is buffered in RAM for the Highway upload, so a
1.5 GiB send costs ~1.5 GiB+ of process memory — that, not a QQ limit,
is what bounds the ceiling.
This commit is contained in:
DrSmoothl committed 2026-07-04 23:45:36 +08:00
1 parent 9a6c17cb27
commit c236bc86ee
3 files changed
+27 -24

No files matched your search

@@ -96,15 +96,17 @@ describe('send_group_msg large-video fallback', () => {
describe('videoNeedsFileFallback', () => {
it('triggers on a known oversize source regardless of the error message', () => {
// The real-bot case: a local 1.4 GB video whose Highway upload fails
// with a cryptic `error_code=323` (not size-worded). Source size is
// known, so the file fallback must still fire.
const big = { type: 'video', fileSize: 1400 * MB } as MessageElement;
// Above MAX_VIDEO_SIZE (1.5 GiB) the video is re-routed to the file
// pipeline even when the error isn't size-worded. Source size is known,
// so the fallback fires from the size alone.
const big = { type: 'video', fileSize: 1700 * MB } as MessageElement;
expect(videoNeedsFileFallback(big, /* isSizeErr */ false)).toBe(true);
});
it('does not trigger for a known under-limit source', () => {
const small = { type: 'video', fileSize: 50 * MB } as MessageElement;
it('does not trigger for a known under-limit source (now covers large videos)', () => {
// 500 MB used to route to file under the old 100 MB cap; it now sends as
// a real video (verified on tempserver up to ~500 MB).
const small = { type: 'video', fileSize: 500 * MB } as MessageElement;
expect(videoNeedsFileFallback(small, true)).toBe(false);
});