2anki / server

Server to create Anki flashcards faster, easier and better today ⭐️
https://2anki.net
Other
300 stars 33 forks source link

Partial zip uploads #1541

Open aalemayhu opened 1 month ago

aalemayhu commented 1 month ago

We are occasionally still seeing the invalid zip

Error copying file undefined: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
Error: invalid zip data
    at unzipSync (/home/alemayhu/src/github.com/2anki/2anki.net/node_modules/fflate/lib/node.cjs:2664:13)
    at ZipHandler.build (/home/alemayhu/src/github.com/2anki/2anki.net/src/lib/anki/zip.tsx:41:32)
    at /home/alemayhu/src/github.com/2anki/2anki.net/src/usecases/uploads/GeneratePackagesUseCase.ts:41:14
    at Generator.next (<anonymous>)
    at /home/alemayhu/src/github.com/2anki/2anki.net/src/usecases/uploads/GeneratePackagesUseCase.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/alemayhu/src/github.com/2anki/2anki.net/src/usecases/uploads/GeneratePackagesUseCase.js:4:12)
    at getPackagesFromZip (/home/alemayhu/src/github.com/2anki/2anki.net/src/usecases/uploads/GeneratePackagesUseCase.ts:33:29)
    at GeneratePackagesUseCase.<anonymous> (/home/alemayhu/src/github.com/2anki/2anki.net/src/usecases/uploads/GeneratePackagesUseCase.ts:97:51)
    at Generator.next (<anonymous>) {
  code: 13
}

I still think a fallback to bsdtar is better than total failure but it can not be the default.