Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Shift 'registerRunStart' call to after 'autoInstantiate' check in 'useMarimoWebSocket'. (#291)

Myles Scolnickeb6e269bccdb
diff --git a/frontend/src/core/websocket/useMarimoWebSocket.tsx b/frontend/src/core/websocket/useMarimoWebSocket.tsx
index 8830a4169b..e72ed6b5b0 100644
--- a/frontend/src/core/websocket/useMarimoWebSocket.tsx
+++ b/frontend/src/core/websocket/useMarimoWebSocket.tsx
@@ -88,8 +88,6 @@ export function useMarimoWebSocket(opts: {
objectIds.push(objectId);
values.push(entry.value);
});
- // Start the run
- RuntimeState.INSTANCE.registerRunStart();
// Register the configs
saveCellConfig({
configs: Object.fromEntries(
@@ -102,6 +100,8 @@ export function useMarimoWebSocket(opts: {
});
// Send the instantiate message
if (autoInstantiate) {
+ // Start the run
+ RuntimeState.INSTANCE.registerRunStart();
sendInstantiate({ objectIds, values }).catch((error) => {
showBoundary(new Error("Failed to instantiate", { cause: error }));
});