Repository navigation
Fix display panels not recovering from script errors after external edits - #91
Merged
Merged
Conversation
…dits Script changes made by an external editor were applied on the file watcher thread. Resolving the cached error there could not find the part's network, as the world can not be accessed off-thread, so the variable kept its error. Externally changed disks are now reloaded on the server tick. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
…directly Initializing the scripting data before its first tick, as tests do, made the tick initialize it again. This replaced the watch service and started a second watcher thread, so changes in some directories could be missed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Coverage Report for CI Build 39276759378Coverage increased (+0.4%) to 45.662%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions41 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a script was broken and then fixed in an external editor, a display panel using it kept showing the old error forever.
Cause: the file watcher thread applied external changes directly, so the error's resolution listeners ran off the server thread. The panel's listener looks up its network via the world, and
Level.getBlockEntityreturns null off-thread, so the variable was never refreshed and kept rethrowing its cached error. Edits from the terminal were fine since they run on the server thread.Fix: the watcher now only queues the changed disk, and
ScriptingData.tick()(server tick) reloads it. This also stops script listeners and caches from being touched by the watcher thread in general.Tests:
testScriptsDisplayScriptErrorResolvedAfterExternalFixwrites the fix to the file on disk. It fails on master and passes with this change.ScriptingDataTesthelpers now tick while waiting for external changes.Generated by Claude Code