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
For some reason, ever since we updated python-statemachine to 2.4.0, measure scripts haven't been running. We possibly didn't notice because you have to explicitly update your poetry environment with poetry install in order to get the newer versions of packages (and this bug).
To reproduce:
Ensure your virtual env is up to date by running poetry install
Connect to dummy devices
Start running a measure script
The progress bar will be stuck on the "moving to x" step forever
If you downgrade python-statemachine with pip install python-statemachine==2.3.6 then it will magically start working again.
The underlying problem seems to be that the ScriptRunner.finish_moving() method isn't actually being called anymore when the move.end device message is sent via PubSub. finish_moving() is a "transition" which is a kind of callable object defined by the python-statemachine library for changing between states. No idea why this is the case, but PyPubSub does save these subscribed functions using weak refs, so maybe that's the culprit? Who knows.
Wrapping finish_moving() in a regular method works as a workaround, but I'm slightly concerned that the same kind of issue is present elsewhere, so I'd rather not do this (plus, what we're doing should work!). There is a @dependabot PR open to bump the version to 2.5.0 (#735) but this doesn't fix things, sadly.
I think I'll pin the version for now and when I've got time I'll try to root-cause it so we can report it upstream. Ideally we don't want to have to keep the version pinned forever.
The text was updated successfully, but these errors were encountered:
The latest version has a bug which means that measure scripts no longer work properly (see #739). Pin to an older version for now until it can be fixed upstream.
For some reason, ever since we updated
python-statemachine
to 2.4.0, measure scripts haven't been running. We possibly didn't notice because you have to explicitly update yourpoetry
environment withpoetry install
in order to get the newer versions of packages (and this bug).To reproduce:
poetry install
If you downgrade
python-statemachine
withpip install python-statemachine==2.3.6
then it will magically start working again.The underlying problem seems to be that the
ScriptRunner.finish_moving()
method isn't actually being called anymore when themove.end
device message is sent via PubSub.finish_moving()
is a "transition" which is a kind of callable object defined by thepython-statemachine
library for changing between states. No idea why this is the case, but PyPubSub does save these subscribed functions using weak refs, so maybe that's the culprit? Who knows.Wrapping
finish_moving()
in a regular method works as a workaround, but I'm slightly concerned that the same kind of issue is present elsewhere, so I'd rather not do this (plus, what we're doing should work!). There is a @dependabot PR open to bump the version to 2.5.0 (#735) but this doesn't fix things, sadly.I think I'll pin the version for now and when I've got time I'll try to root-cause it so we can report it upstream. Ideally we don't want to have to keep the version pinned forever.
The text was updated successfully, but these errors were encountered: