Skip to content
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

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

Closed
ghost opened this issue Jan 18, 2021 · 9 comments
Closed
Assignees
Labels
bug Something isn't working IN NEXT Test by installing `overmind@next`, also on related packages NEXT RELEASE important thing to fix

Comments

@ghost
Copy link

ghost commented Jan 18, 2021

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

@ghost ghost added the bug Something isn't working label Jan 18, 2021
@ghost ghost assigned christianalfoni Jan 18, 2021
@christianalfoni
Copy link
Member

@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?

@christianalfoni
Copy link
Member

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

@ghost
Copy link
Author

ghost commented Jan 18, 2021

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.

@christianalfoni
Copy link
Member

Okay, cool, let me look at the hot reload issue in the meantime 😄

@ghost
Copy link
Author

ghost commented Jan 19, 2021

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.

@christianalfoni christianalfoni added the NEXT RELEASE important thing to fix label Feb 28, 2021
@christianalfoni
Copy link
Member

Hi @max-lvl-noob , this work in next 😄

@christianalfoni christianalfoni added the IN NEXT Test by installing `overmind@next`, also on related packages label Mar 7, 2021
@SearleWork
Copy link

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.

@christianalfoni
Copy link
Member

christianalfoni commented Jun 24, 2021

Released! 🎉

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

@SearleWork
Copy link

Resubmitted as #517

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working IN NEXT Test by installing `overmind@next`, also on related packages NEXT RELEASE important thing to fix
Projects
None yet
Development

No branches or pull requests

2 participants