Skip to content

Fixes issues with redux.#315

Merged
wilkie merged 2 commits into
mainfrom
fix-redux-issues
May 26, 2026
Merged

Fixes issues with redux.#315
wilkie merged 2 commits into
mainfrom
fix-redux-issues

Conversation

@wilkie
Copy link
Copy Markdown
Contributor

@wilkie wilkie commented May 26, 2026

We need to make this package's redux the same version as the apps main.

We also need to make sure we don't update state inside a reducer and instead queue a microtask. Otherwise the app crashes when selecting datasets.

This problem was discovered on the last level of ailab in CSD Unit 7. It's a rare interaction. This will fix the last remaining issue that I can see at the moment such that we can enable this build on production.

wilkie added 2 commits May 26, 2026 02:50
We need to make this package's redux the same version as the apps main.

We also need to make sure we don't update state inside a reducer and
instead queue a microtask. Otherwise the app crashes when selecting
datasets.
Comment thread src/redux.ts
// microtask so the dispatch fully unwinds before the callback fires.
if (state.instructionsKeyCallback) {
const callback = state.instructionsKeyCallback;
queueMicrotask(() =>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! Ideally we wouldn't have a callback in here at all and/or move this to a thunk, but that can happen later

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. I don't like a bit of how this is working from a certain standpoint, but the key word there is it is working. When we port it into the actual main repo, we have much more opportunity to clean it up. I'm not sure if ml-playground itself really needs its own redux to do what it is doing anyway.

@wilkie wilkie merged commit 213d788 into main May 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants