Ironclad / rivet

The open-source visual AI programming environment and TypeScript library
https://rivet.ironcladapp.com
MIT License
2.56k stars 226 forks source link

[Bug]: Loading a project twice can trigger a "split()" error message. #282

Closed codemile closed 5 months ago

codemile commented 6 months ago

What happened?

Steps to reproduce:

Triggers an error message "Failed to load project: ...."

You can't tell what the error was, because that toast is trying to read the fsPath which is undefined producing a Cannot read properties of undefined but if you fix that error, then the error message is XXX shares the same ID (###) and is already open.

Work around solution to bug

This works because it appears Rivet is keeping at least 1 last closed project in localStorage. So you need to cycle a few projects to clear state.

What was the expected functionality?

Rivet should be able to load projects from a file if there is no tab visible saying it's already loaded.

Describe your environment

Windows, Node 20.10.0,

Relevant log output

No response

Relevant screenshots

image

Code of Conduct

codemile commented 6 months ago

Here we can see that localStorage has 2 projects in the open state, but only 1 project is currently shown in the UI after the second was closed. I think the Recoil code that pushes state to localStorage is lagging behind by 1 operation, because if you create a new blank project it removes that project that was closed.

image