-
-
Notifications
You must be signed in to change notification settings - Fork 466
Fixed run button state reset on route change and state stale issue when a model fails to load #859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…en a model fails to load
…after being deleted
|
This PR fixes three issues on the foundation page:
|
deep1401
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay all 3 points worked for me but I have a tiny nitpick here.
When I tried to do delete a model which was running, it just ejected for me and now I'm stuck in this state:
Not sure what the right answer is here but I dont know if disabling the delete button for the running model entry would be going too far?
I'll just also wait for @dadmobile to comment on this one
|
I'd be fine with either:
|
|
Sure I would try doing the second one maybe? |
…ab-app into fix/foundation-page-state
|
Changes made:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deep1401
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updating the review here as it got posted without changing the PR state
|
@deep1401 Noted. I implemented the changes and now only the model currently running will be disabled:
|
deep1401
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I tried this for 4 cases:
- HF Model
- Trained model by our plugin
- GGUF model downloaded from HF
- GGUF model exported by our plugin
It works for everything. Just adding a similar comment here as one of the other PRs that we can wait for @dadmobile to take a final look before we merge
|
😄 |
| setLogsDrawerOpen = null, | ||
| }) { | ||
| const [jobId, setJobId] = useState(null); | ||
| const storageKey = experimentInfo?.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Putting this in local storage seems like overkill? i'm guessing there was a problem with just using state?
| }, [storageKey]); | ||
|
|
||
| useEffect(() => { | ||
| if (!storageKey || !window.storage) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is so much new code for this one condition! I feel confident there must be a way to simplify/refactor this so it's not so complex? I feel we've already made it too complex and that's why we are having these bugs in the first place.
Let me take a closer look when I'm not on a plane and see if I can make some suggestions.
dadmobile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to go back to the drawing board here. As we've seen trying to debug the STT plugin issues, this screen is already too complicated. If anything let's try to figure out how to simplify/factor/abstract the variables to make this more clear as it did once work correctly!
Things we shouldn't be doing in this PR:
- Don't use storage: Generally the purpose of using storage would be to persist so that you can survive an app restart. That isn't what we are trying to do here.
- Avoid setInterval: If we think we need to use that it usually means we're doing something wrong/overly complicated with React.
- minimize useEffect: we're adding 3 effects with 7 different dependencies all of which can trigger re-renders. That's got to be overkill.
Before even trying to fix these bugs I'd almost be tempted to feed to original file into the AI and see if it can figure out how to simplify the dependencies. You might get some bug fixes for free. :)
|
@dadmobile The state of the run button depends on the storage because The Run button UI reads and writes a per‑experiment marker to persistent storage (the |
|
it also needs the setInterval there to keep polling for the state of |
|
Because of that removing even one storage key stops the entire effect to happen |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ab-app into fix/foundation-page-state


Fixes two known issues on the foundation page:
Fixes #852
Fixes #850