stations: reduce ChemistryStation recipe/entry duplicate warning noise#43
Conversation
📝 WalkthroughWalkthroughRefactors conflict logging in chemistry station recipe injection from global HashSet-based tracking to per-canvas state management. Updates helper methods from boolean returns to nullable object returns, enabling direct access to conflicting recipe or entry instances while maintaining per-canvas conflict history. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Comment |
Summary
This PR reduces log noise in
ChemistryStationPatchesby treating repeated/in-idempotent injections as normal behavior (no log spam), while still warning on real conflicts.What’s changed
ChemistryStationPatchesduplicate handling is now conflict-aware:RecipeIDis already present and it’s the same recipe instance S1API would inject, S1API stays silent.RecipeIDis present but it’s a different recipe instance, S1API warns once and skips injection for that ID.recipeEntries(existing entry for the sameRecipeID):ConditionalWeakTable<ChemistryStationCanvas, …>.Notes / rationale
Awake/Openmultiple times across normal play. Logging “already has X” in those cases creates unnecessary noise even though the behavior is correct and idempotent.Release Notes
ConditionalWeakTable-based per-canvas state (CanvasInjectionState) to track warned-once conflicts, keeping tracking minimal and localizedContainsRecipeId()→FindRecipeById()(now returnsStationRecipe?instead of bool)ContainsEntryForRecipeId()→FindEntryByRecipeId()(now returnsStationRecipeEntry?instead of bool)Lines Added/Removed by Author