Skip to content

Conversation

@mclift
Copy link
Member

@mclift mclift commented Aug 21, 2025

This PR addresses issue #624, in which a breaking change in v5.18.0 caused asynchronous substate transitions to be ignored when a viable parent state transition is configured. These changes are intended to restore the transition precedence from prior releases.

  • Fixed the trigger handler selection logic in StateRepresentation.Async.cs so that substate (local) transitions are preferred over superstate transitions in async scenarios. This ensures correct transition precedence when both substate and superstate can handle the same trigger.

  • Added new tests in TransitionFixture.cs to verify that substate transitions correctly override superstate transitions for both synchronous and asynchronous trigger firing.

  • Improved test naming and clarity in TransitionFixture.cs for reentry and transition tests, making the intent of each test clearer.

…itions when they override a parent state's transitions.

namespace Stateless.Tests
{
public class TransitionFixture
Copy link
Contributor

@RedOrc RedOrc Aug 21, 2025

Choose a reason for hiding this comment

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

Very minor @mclift, but can we be explicit about the class name? I think changing this from TransitionFixture to TransitionFixtureTest is better. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'm right in saying that the "Fixture" nomenclature was simply in common use when this library was first written and that just "Tests" would be more idiomatic now. Given there's a mixture of both in the project, perhaps renaming them all would be the right thing to do?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mclift Agreed. If you like, I can take care of them after my other PR is merged.

Copy link
Member Author

Choose a reason for hiding this comment

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

@RedOrc Sounds good. I've done this one in the meantime.

@mclift mclift merged commit 12ca516 into dotnet-state-machine:dev Aug 22, 2025
1 check passed
@mclift mclift mentioned this pull request Aug 22, 2025
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