Skip to content

Fix guide source watcher erroring when a file is deleted (#158) [26.1] - #163

Merged
shartte merged 1 commit into
26.1from
fix-158-source-watcher-delete-26.1
Nov 13, 2026
Merged

shartte merged 1 commit into
26.1from
fix-158-source-watcher-delete-26.1

Conversation

@shartte

@shartte shartte commented Nov 13, 2026

Copy link
Copy Markdown
Member

Backport of #162 to 26.1.

Deleting a file in a watched guide source folder crashed the watcher with InvalidPathException: Illegal char <:>, because pageDeleted resolved Identifier.toString() (namespace:path) against the source folder.

  • Use pageId().getPath() for the default-language fallback path.
  • Only try the fallback when the default-language page exists.
  • Log the fallback path when parsing it fails.

Includes an integration test that watches a temporary directory with a real DirectoryWatcher, deletes pages on disk and waits for the reported changes (Awaitility added as a test-only dependency).

Closes #158

Backport of #162.

pageDeleted built the fallback path for language-specific pages with
Identifier.toString(), which yields "namespace:path". Resolving that
against the source folder throws InvalidPathException on Windows because
of the colon, aborting the watcher event. Use the identifier's path
component instead and only try the fallback if the default-language page
actually exists.

Adds an integration test that watches a temporary directory with a real
DirectoryWatcher and deletes pages, using Awaitility for the polling.
@github-actions github-actions Bot added the MC 26.1 Targets Minecraft 26.1 label Nov 13, 2026
@shartte
shartte merged commit 89fcf9d into 26.1 Nov 13, 2026
7 checks passed
@shartte
shartte deleted the fix-158-source-watcher-delete-26.1 branch November 13, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MC 26.1 Targets Minecraft 26.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant