Skip to content

🐛 Fix empty path deletion on iOS#610

Merged
vinceglb merged 1 commit into
mainfrom
codex/reproduce-issue-592
Jul 9, 2026
Merged

🐛 Fix empty path deletion on iOS#610
vinceglb merged 1 commit into
mainfrom
codex/reproduce-issue-592

Conversation

@vinceglb

@vinceglb vinceglb commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Treat an empty NSURL as an empty Kotlin path on Apple platforms.
  • Preserve FileKitNSURLNullPathException for other pathless URLs.
  • Add regression coverage for PlatformFile("").delete(mustExist = false).

This makes empty-path deletion consistent with Android when mustExist is false.

Fixes #592

Verification

  • Targeted iOS simulator regression test
  • ./gradlew :filekit-core:check
  • Kotlin lint
  • git diff --check

@vinceglb vinceglb changed the title 🩹 Handle empty NSURL paths in delete flow 🐛 Fix empty path deletion on iOS Jul 9, 2026
@vinceglb

vinceglb commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review this

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@vinceglb
vinceglb merged commit 32e6699 into main Jul 9, 2026
9 checks passed
@vinceglb
vinceglb deleted the codex/reproduce-issue-592 branch July 9, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent behavior for empty file paths between Android and iOS

1 participant