Skip to content

Fix duplicate crafting job dependencies when interfaces re-register - #249

Merged
rubensworks merged 1 commit into
master-1.20-ltsfrom
fix/duplicate-dependency-edges-1.20
Oct 14, 2026
Merged

rubensworks merged 1 commit into
master-1.20-ltsfrom
fix/duplicate-dependency-edges-1.20

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Backport of #248 to 1.20.

When a crafting interface becomes dirty, it unregisters and re-registers to the crafting network. removeCraftingInterface keeps the dependency edges of its jobs, while addCraftingInterface adds them again, and CraftingJobDependencyGraph.addDependency did not check for existing edges. Each re-registration therefore duplicated them, which shows up as duplicated subtrees in the plan of a running job.

addDependency now stores each edge (and its reverse link) only once. Covered by unit tests; the game test from #248 is not included since this branch has no game tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y


Generated by Claude Code

Crafting interfaces re-register to the network when they become dirty,
which added the dependencies of their jobs to the dependency graph again.
This caused duplicated subtrees in crafting plans of running jobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5iUzweRYoCkKB5bvJdH8Y
@rubensworks
rubensworks merged commit 07fe9fc into master-1.20-lts Oct 14, 2026
5 checks passed
@rubensworks
rubensworks deleted the fix/duplicate-dependency-edges-1.20 branch October 14, 2026 18:07
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.

2 participants