🐛 Fix empty path deletion on iOS#610
Conversation
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3637e61aa3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| @Test | ||
| fun PlatformFile_deleteEmptyPathWithMustExistFalse_doesNothing() = runTest { | ||
| PlatformFile("").delete(mustExist = false) |
There was a problem hiding this comment.
Avoid running this iOS-only regression on JVM
This test lives in the shared nonWebTest source set, which is wired into jvmTest as well as native tests. On JVM, PlatformFile("") wraps java.io.File(""), i.e. the current working directory; because it exists, delete(mustExist = false) still attempts File.delete() and a non-empty checkout returns false, causing IOException("Deletion failed") and breaking :filekit-core:jvmTest/check. Please scope this regression to Apple/native or make JVM handle empty paths consistently before sharing the test.
Useful? React with 👍 / 👎.
Summary
NSURLas an empty Kotlin path on Apple platforms.FileKitNSURLNullPathExceptionfor other pathless URLs.PlatformFile("").delete(mustExist = false).This makes empty-path deletion consistent with Android when
mustExistisfalse.Fixes #592
Verification
./gradlew :filekit-core:checkgit diff --check