You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: re-enqueue initial event when deserializing async state machine (#544)
When an async SM is pickled/deepcopied (e.g. via multiprocessing), the
engine queue is not preserved. __setstate__ recreated the engine but
never called start(), so the __initial__ event was never enqueued and
activate_initial_state() would fail with InvalidStateValue.
Closes#544
* fix: await async predicates in condition expressions (#535)
The boolean expression combinators (custom_not, custom_and, custom_or,
build_custom_operator) called predicates synchronously. When predicates
were async, they returned unawaited coroutine objects which are always
truthy, causing `not` to always return False, `and` to skip evaluation,
and `or` to short-circuit incorrectly.
Each combinator now checks `isawaitable()` on predicate results and
returns a coroutine when needed, which CallbackWrapper.__call__ already
knows how to await.
Closes#535
* chore: sync pre-commit ruff rev with lockfile (v0.15.0)
The pre-commit hook was using ruff v0.8.1 while the lockfile had v0.15.0,
causing import sorting differences between local and CI.
* fix: address SonarCloud code smells in tests
- Add docstrings to empty async on_enter_state methods (S1186)
- Use await asyncio.sleep(0) in async test hooks to satisfy S7503
* feat: add `enabled_events()` method to check guard conditions (#520)
`allowed_events` returns events reachable from the current state but does
not evaluate `cond`/`unless` guards. The new `enabled_events()` method
evaluates conditions and returns only events that can actually fire.
It accepts `*args`/`**kwargs` forwarded to condition callbacks, works with
both sync and async engines, and treats condition exceptions as enabled
(permissive behavior).
Closes#520
0 commit comments