Files
readest/apps/readest-app/.claude/memory/in-place-delete-wiped-originals.md
T
2026-06-21 19:09:21 +02:00

2.1 KiB

name, description, metadata
name description metadata
in-place-delete-wiped-originals Deleting a "Read books in place" book from Readest used to permanently delete the user's original source file; fixed (PR #4696) to never touch external sources
node_type type originSessionId
memory project 432bbb95-47b4-4d9c-825b-528168e2cfb7

User report (v0.11.12 Windows): imported a folder via "Import From Directory" with Read books in place, later deleted the books in-app, and Readest permanently deleted the original local files (not even sent to Recycle Bin). Files were unrecoverable; cloud sync hadn't uploaded them yet ("Book File Not Uploaded").

Root cause: deleteBook in src/services/cloudService.ts. For local/both/purge, it called resolveBookContentSource (src/services/bookContent.ts) and, when source.kind === 'external' (i.e. book.filePath set, base 'None' — the user's own file from an in-place or transient import), unconditionally fs.removeFile(source.path, source.base). book.filePath is set in bookService.ts importBook whenever transient || inPlace.

The trap: this was NOT an accidental bug — it was deliberately coded AND tested. cloud-service.test.ts had a whole in-place (book.filePath set) describe block asserting the source file IS removed, with a comment rationalizing it as "symmetric with deleting Books//