aasm/lib/aasm/core
Guewen Baconnier 1a1b836ded
Fix multi-threading bug not firing success callbacks (#778)
`@valid_transitions` is shared across threads, when a thread consumes a
transition, another thread which should execute the same transition for
another model instance may ignore its success callback.

This change avoid to share the same hash of transition across different
model instances. Each instance will have its own hash of transitions.
The hash itself is not subject to thread race conditions as the object ids
are unique. Also, the transitions for an object_id are cleaned after the
transition have been fired, otherwise the hash would grow infinitely.

See https://github.com/aasm/aasm/issues/448#issuecomment-377922368 for
an example of code to reproduce the multi-thread bug.

Fixes #448
2022-03-22 18:06:46 +05:30
..
invokers chore(invokers): Refactor callback invokers, add class-callbacks support 2018-06-19 21:11:56 +03:00
event.rb Fix multi-threading bug not firing success callbacks (#778) 2022-03-22 18:06:46 +05:30
invoker.rb chore(invokers): Refactor callback invokers, add class-callbacks support 2018-06-19 21:11:56 +03:00
state.rb Uses the default_display_name for localizer 2020-10-15 14:22:31 +05:30
transition.rb Relocate DslHelper from root namespace to under AASM namespace 2020-10-11 00:03:11 +05:30