Currently, we are subscribing to the compute block status websocket as soon as a project is selected.
This can lead to weird errors when switching projects too fast.
We should only connect to this websocket if a project is currently running (we have this information from the project status websocket).
I tried to implement this in #122, however noticed this would be much out of scope as it would require (if done in a nice manner) a refactoring of the central state handling. (e.g. using zustand for handling, updating & sharing state across components).
We could also think about changing the websockets desing to one that sends events, that we can handle in the frontend, instead of just polling airflow and providing the frontend with this data.
e.g.
{
type: "PROJECT_STATUS_CHANGED",
data: {
id: "uuid",
status: "RUNNING"
}
}
Currently, we are subscribing to the compute block status websocket as soon as a project is selected.
This can lead to weird errors when switching projects too fast.
We should only connect to this websocket if a project is currently running (we have this information from the project status websocket).
I tried to implement this in #122, however noticed this would be much out of scope as it would require (if done in a nice manner) a refactoring of the central state handling. (e.g. using zustand for handling, updating & sharing state across components).
We could also think about changing the websockets desing to one that sends events, that we can handle in the frontend, instead of just polling airflow and providing the frontend with this data.
e.g.
{ type: "PROJECT_STATUS_CHANGED", data: { id: "uuid", status: "RUNNING" } }