Skip to content

Fixed cue magnitude reentracy. - #67

Merged
lextatic merged 2 commits into
mainfrom
bugfix/cue-magnitude-reentrancy
Sep 19, 2026
Merged

lextatic merged 2 commits into
mainfrom
bugfix/cue-magnitude-reentrancy

Conversation

@lextatic

Copy link
Copy Markdown
Contributor

Fire cues before executed/changed hooks so a hook re-applying an effect to the target can't flush the deltas AttributeValueChange cues read.

Fire cues before executed/changed hooks so a hook re-applying an effect
to the target can't flush the deltas AttributeValueChange cues read.
@lextatic lextatic added the fixed General bug fixes label Sep 19, 2026
@lextatic
lextatic requested a balanced review from Copilot September 19, 2026 00:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Cue callbacks can now mutate or remove effects before their lifecycle components process the original operation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Reorders cue dispatch so attribute-change magnitudes are read before reentrant effect hooks can flush pending deltas.

Changes:

  • Executes cues before effect-executed and active-effect-changed hooks.
  • Adds regression tests for both execution and stacking updates.
File Description
Forge/​Effects/​EffectsManager.cs Reorders execution cues before hooks.
Forge/​Effects/​ActiveEffect.cs Reorders stacking-update cues before change hooks.
Forge.Tests/​Cues/​CueMagnitudeReentrancyTests.cs Tests reentrant cue magnitudes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Forge/Effects/ActiveEffect.cs Outdated
Comment thread Forge/Effects/EffectsManager.cs Outdated
Read cue magnitudes before the hooks but dispatch the handlers after
them, so components and changed callbacks keep running first
@lextatic
lextatic merged commit 5046e6b into main Sep 19, 2026
1 check passed
@lextatic
lextatic deleted the bugfix/cue-magnitude-reentrancy branch September 19, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed General bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants