fix: wrap Bun.file().stream() in Readable.from() for Telegraf compat
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:
Claude
2026-07-29 17:26:51 +07:00
parent 1ecab987a6
commit d22f788e3e
2 changed files with 4 additions and 4 deletions
+1 -2
View File
@@ -17,8 +17,6 @@ beforeAll(async () => {
'hex',
);
}
// Pre-create temp file for multipart upload test
await Bun.write('/tmp/filedrop-test-photo', realPhotoBuffer);
});
// Mock db
@@ -113,6 +111,7 @@ describe('Upload Route Handler', () => {
mockFileRepo.create.mockClear();
mockForwardToStorage.mockClear();
mockFindByHashResult = null;
nanoidCounter = 0;
const uploadRoute = await import('../src/interfaces/http/controllers/upload-controller');
handleUpload = uploadRoute.handleUpload;
});