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
On the backend, we re-run a condition when a new action is taken on it, but what about when the condition times out, for instance when the voting period in a voting condition expires? Not only is there no way on the front end to poll open conditions, we don't even have a mechanism on the backend.
Furthermore, on the front end: when a condition passes and it updates the action on the backend, we don't necessarily know what to update on the front end. For instance, if a condition passes for "add_role", we don't know which role to add, or even that it was an add role action that is ready to go.
So we need two things. First, we need something on the backend that watches for conditions to time out. And then second, we need some way for the backend to tell the front end that an action has been implemented so it can update data appropriately.
One temporary hack is to create a method on actions_include that looks for all waiting conditions and refreshes them when the component is mounted; this would be a call to the server that actually re-runs the condition and, if the condition changes status, would then automatically re-run the action. Not sure how the data would make it back to the front end though. Presumably there's something that can be done that's a push to the front end, rather than a pull from it?
The text was updated successfully, but these errors were encountered:
Okay, the fix for now is the new management command check_conditional_status which goes through all conditions, looks for those of a class with attribute "has_timeout" and if there's a timeout, checks to see if timeout has happened. If it has, it sends a signal to re-run the associated action. It's not very efficient, since this is going to rerun every condition that has ever timed out, but we can fix that inefficiency later.
Once this site is in production, I'll set up a chron job to call the command every five minutes or so.
On the backend, we re-run a condition when a new action is taken on it, but what about when the condition times out, for instance when the voting period in a voting condition expires? Not only is there no way on the front end to poll open conditions, we don't even have a mechanism on the backend.
Furthermore, on the front end: when a condition passes and it updates the action on the backend, we don't necessarily know what to update on the front end. For instance, if a condition passes for "add_role", we don't know which role to add, or even that it was an add role action that is ready to go.
So we need two things. First, we need something on the backend that watches for conditions to time out. And then second, we need some way for the backend to tell the front end that an action has been implemented so it can update data appropriately.
One temporary hack is to create a method on actions_include that looks for all waiting conditions and refreshes them when the component is mounted; this would be a call to the server that actually re-runs the condition and, if the condition changes status, would then automatically re-run the action. Not sure how the data would make it back to the front end though. Presumably there's something that can be done that's a push to the front end, rather than a pull from it?
The text was updated successfully, but these errors were encountered: