You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am able to reproduce this problem in v0.73.1ImportMarkdownZipTask.test.ts tests:
it("should not corrupt files in zip",async()=>{constfileOperation=awaitbuildFileOperation();Object.defineProperty(fileOperation,"stream",{get(){returnfs.createReadStream(path.resolve(__dirname,"..","..","test","fixtures","outline-markdown-with-pdf.zip"));},});jest.spyOn(FileOperation,"findByPk").mockResolvedValue(fileOperation);constprops={fileOperationId: fileOperation.id,};consttask=newImportMarkdownZipTask();constresponse=awaittask.perform(props);expect(response.attachments.size).toEqual(1);constattachments=Array.from(response.attachments.values());constattachment=attachments.find((att)=>att.key.endsWith("license.pdf"));attachment?.buffer.then((buffer)=>{constmd5=createHash("md5");md5.write(buffer);consthash=md5.digest().toString("hex");expect(hash).toEqual("bda05f729bb1cfc11a08576d738b5add");});},10000);
Hi @aponad thanks for filing – I was able to confirm with your test that this is already fixed on main (we removed unzipper due to similar issues elsewhere).
All non image files imported to Outline are currupted.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Imported files are not modified or corrupted.
Outline (please complete the following information):
Works fine on
v0.72.2
and I was unable to recreate it onmain
branch with nodev18
orv20
(switch toyauzl
seems to fix it).I think this is related to
node-unzipper
library and this issue ZJONSSON/node-unzipper#286 (comment).I am able to reproduce this problem in
v0.73.1
ImportMarkdownZipTask.test.ts
tests:Fixture: outline-markdown-with-pdf.zip
The text was updated successfully, but these errors were encountered: