Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Exporting rooms messages as file throws error on server side #29903

Closed
wants to merge 10 commits into from
3 changes: 2 additions & 1 deletion apps/meteor/server/ufs/ufs-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function ufsComplete(fileId: string, storeName: string): Promise<IU
const rs = fs.createReadStream(tmpFile, {
flags: 'r',
encoding: undefined,
autoClose: true,
autoClose: false,
});

// Clean upload if error occurs
Expand All @@ -58,6 +58,7 @@ export async function ufsComplete(fileId: string, storeName: string): Promise<IU
// Save file in the store
await store.write(rs, fileId, (err, file) => {
removeTempFile();
rs.close();

if (err) {
return reject(err);
Expand Down