Skip to content

fix: honor Event(internal=True) when the event is triggered - #663

Open
chiliec wants to merge 1 commit into
fgmacedo:developfrom
chiliec:fix/event-internal-at-trigger
Open

chiliec wants to merge 1 commit into
fgmacedo:developfrom
chiliec:fix/event-internal-at-trigger

Conversation

@chiliec

@chiliec chiliec commented Sep 24, 2026

Copy link
Copy Markdown

Fixes #655.

Event(a.to(b), internal=True) was preserved on the declaration but never reached the queue:

  • Event.__get__ built the BoundEvent without internal, so sm.go() always put on the external queue.
  • StateChart.send read delay from the declared event but not internal, so sm.send("go") ignored it too.

Fix: pass internal through in __get__, and in send fall back to the declared event's internal when the caller did not pass internal=True (same precedence as delay).

Per the issue notes: dropped the "internal still has no effect at trigger time" caveat from docs/releases/3.2.2.md, added a 3.2.2 release-notes entry, and listed the declarative form in the queue table in docs/processing_model.md.

Tests

TestExplicitEvent.test_declared_internal_puts_on_the_internal_queue (parametrized over sm.light() and sm.send("light")) records the internal flag passed to the engine's put. It fails on develop for both paths ([False]) and passes with this change.

  • uv run pytest: 2020 passed, 144 skipped, 44 xfailed
  • uv run ruff check / ruff format --check / mypy statemachine: clean

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

internal declared on an Event has no effect at trigger time

1 participant