Skip to content

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

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

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

Conversation

@shartte

@shartte shartte commented Nov 13, 2026

Copy link
Copy Markdown
Member

Backport of #162 to 1.21.1.

Deleting a file in a watched guide source folder crashed the watcher with InvalidPathException: Illegal char <:>, because pageDeleted resolved ResourceLocation.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
ResourceLocation.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 location'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 1.21.1 Targets Minecraft 1.21.1 label Nov 13, 2026
@shartte
shartte merged commit 2be5dd6 into 1.21.1 Nov 13, 2026
5 checks passed
@shartte
shartte deleted the fix-158-source-watcher-delete-1.21.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 1.21.1 Targets Minecraft 1.21.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant