fix: wrap Bun.file().stream() in Readable.from() for Telegraf compat
Deploy FileDrop / deploy (push) Failing after 20s
Deploy FileDrop / deploy (push) Failing after 20s
- Replaces createReadStream / bare ReadableStream with Readable.from(Bun.file(path).stream()) — works in both test (Bun.write + Bun.file) and production (Node Readable) - Reverts writeBufferToTemp back to Bun.write
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Readable } from 'node:stream';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { buildNewFile } from '../../../domain/entities/file-factory';
|
||||
import { config } from '../../../env';
|
||||
@@ -206,7 +207,7 @@ const handleMultipartUpload = async (req: Request): Promise<Response> => {
|
||||
|
||||
// Single-message — direct to Telegram storage
|
||||
const forwardResult = await telegramService.forwardToStorage(
|
||||
Bun.file(prepared.tempPath).stream(),
|
||||
Readable.from(Bun.file(prepared.tempPath).stream()),
|
||||
finalFileName,
|
||||
fileType,
|
||||
);
|
||||
@@ -318,7 +319,7 @@ const handleJSONUpload = async (req: Request): Promise<Response> => {
|
||||
|
||||
// Single-message — direct to Telegram storage
|
||||
const forwardResult = await telegramService.forwardToStorage(
|
||||
Bun.file(prepared.tempPath).stream(),
|
||||
Readable.from(Bun.file(prepared.tempPath).stream()),
|
||||
finalFileName,
|
||||
fileType,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user