mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 11:48:24 +00:00
deleteRecursivelyQuietly (the okio stand-in for File.deleteRecursively) listed the whole tree with listRecursively(...).toList() inside one try: a single directory that failed to list emptied the list, so nothing was deleted. File.deleteRecursively removed everything it could reach. For the cordn stores that meant a deleted group could keep its plaintext message history, and a migration could merge an imported snapshot into old state. It now lists one directory at a time, so an unlistable directory costs only its own subtree and the result is false. metadataOrNull does not follow symlinks, so a link is still deleted rather than walked into. FileSystemExtTest covers a whole tree, a missing path, a directory that refuses to list (failed before this change: the sibling's messages file survived) and a symlink whose target must survive. Also corrects EncryptedAppendLog's cache-key comment: Path.normalized() does not resolve a relative path against the working directory, unlike File.absolutePath. Every store builds its paths from one directory, so no caller mixes spellings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S7FuNBSKiyVecARSoE4B9P