cerebral/overmind

[BUG] State changes are not reflected in the ui under certain conditions

Opened this issue ยท 9 comments

Hello,
I use overmind with overmind-react in a typescript project.
I recently upgraded my overmind version from 24.1.1 to 26.0.0. After the upgrade, I now have a part of my ui, that does not update to state changes anymore. I tried to recreate the problem on codesandbox, but it only triggers while applying a hot reload to the component (or whatever they use to update the view with the code in real time). Therefore there could be some kind of compatibility problem with the bundler that does the hot reloading? Not so sure on this one.
I use react-scripts on version 4.0.1. There, I have the problem without having to trigger the reloading. Because its kind of weird, I will link my codesandbox and a gif of how I achieved the problem:
codesandbox
state-updates-not-coming-through2

@max-lvl-noob Hi Max and thanks for taking the time to add the issue! ๐Ÿ˜„

Would I be able to reproduce this if I download the sandbox and run it locally with 4.0.1 of react-scrips?

I tried it now, hm... was not able to reproduce. Could you delete your node_modules and install again? Make sure all Overmind packages are installed with latest version ๐Ÿ˜„

What can happen is that for example overmind-react still uses an old version of Overmind or similar

Hey, thanks for the fast response. I tried to recreate the problem with react-scripts 4.0.1. Sadly, the example does not seem to hit the right nerve like my project does. I could reproduce the behavior visible in the gif, where component updates seem to stop after hot reloads.
overmind-update-problem.zip
I will retry tomorrow to produce an example that hits closer to my initially described problem.

Okay, cool, let me look at the hot reload issue in the meantime ๐Ÿ˜„

Hey, I cut down my project to show the problem.
ffmc.zip
If you press the button, a dialog should pop up after a delay, but the component spawning the dialog does not update (DialogRoot.tsx).
If you lower the overmind version to 24.1.1. and overmind-react to 25.1.1, you can see the Dialog pop up without a problem.
I also added devtools to the package.json, you can run it with yarn/npm devtools. There you can see, that the state changes correctly.

Hi @max-lvl-noob , this work in next ๐Ÿ˜„

Hi Christian, I'm on the same team as max-lvl-noob and we have a follow-up bug which might be directly related.

The original problem seams to be fixed but now a similar problem arises with overmind-28/overmind-react-29

I set up the previously attached zip file in codesandbox:
https://codesandbox.io/s/overmind-issue-483-nqdzw

The problem is that state changes in operators do not trigger a re-render. If I use an action instead of an immediate assignment the re-render is triggered.

The code causing the problem is here:
https://codesandbox.io/s/overmind-issue-483-nqdzw?file=/src/overmind/namespaces/transaction/internalActions.ts
on line 18.

Released! ๐ŸŽ‰

could you move this bug, if still an issue into a new issue?

Resubmitted as #517