Skip to content

Commit

Permalink
F/error check (#166)
Browse files Browse the repository at this point in the history
* error check for records

* error check for records
  • Loading branch information
jmagoon authored Jul 19, 2024
1 parent ad89e08 commit 6387eab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 148 deletions.
140 changes: 2 additions & 138 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions frontend/src/components/ui/WorkspaceFetcher.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,20 @@ export default function WorkspaceFetcher() {
const existing = workspace.pipelines[key];

const existingStatus = existing?.record?.Status;
const shouldUpdate = serverPipeline.Status != existingStatus || !existing;
const shouldUpdate =
serverPipeline?.Status != existingStatus || !existing;

if (shouldUpdate) {
const loaded = loadPipeline(serverPipeline, configuration);
console.log(
`updating status ${existingStatus} to ${serverPipeline.Status} for ${key}`,
);
setWorkspace((draft) => {
draft.pipelines[key] = loaded;
draft.executions[loaded.record.Execution] = loaded;
});
try {
const loaded = loadPipeline(serverPipeline, configuration);
setWorkspace((draft) => {
draft.pipelines[key] = loaded;
draft.executions[loaded?.record?.Execution] = loaded;
});
} catch (e) {
console.log("Failed to load ", e);
return;
}
}

const isLogging =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const WebSocketCloseCodes = {
4004: "Room Not Found",
};

export const useStableWebSocket = (url: string | null) => {
export const useStableWebSocket = (url) => {
const [wsError, setWsError] = useState(null);
const reconnectCount = useRef(0);

Expand Down

0 comments on commit 6387eab

Please sign in to comment.