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

Incompatibility of version 6.13.1 with older version (silent failure to track changes) #3918

Open
spion opened this issue Sep 5, 2024 · 2 comments
Labels

Comments

@spion
Copy link

spion commented Sep 5, 2024

Intended outcome:

This is not exactly a bug, but I thought I'd mention it because it can easily be relevant in larger projects and monorepos. Its quite possible for multiple versions of mobx to be installed in a monorepo, and while this is suboptimal (in terms of bundle size and similar), its not typically a true bug.

However, I would expect 6.13.1 to warn when running alongside older versions and report an error, because the changes in internals are significant enough that observables coming from older versions are completely broken / inert when used in a 6.13.1 context.

Actual outcome:

No errors are reported, however changes in observables from an older version of mobx are simply not tracked successfully by 6.13.1

How to reproduce the issue:

Unfortunately, its a bit difficult to create a reproduction case. A monorepo with multiple versions of mobx would be needed

Versions

6.13.1

Workaround

Update the entire monorepo and any relevant dependencies that depend on mobx to 6.13.1

Expectations

It would be good if this situation could be detected and would result with a warning in the console or similar.

@spion spion added the 🐛 bug label Sep 5, 2024
@mweststrate
Copy link
Member

In principle we should have protection against this, and we can bump the version number here if needed:

https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/core/globalstate.ts#L32-L186

So I think we can just bump the version number there and we should be OK.

@johnnywang
Copy link

Came across this issue from a comment on this PR, after trying to debug why our mobile app stopped reacting to changes, where all UI interaction renders seemed to happen a render cycle late.

Narrowed it down to an upgrade we did to the latest mobx, and after trying a bunch of versions out, noticed this same thing, where things are working fine up to 6.13.0, but break as of 6.13.1. Not really sure how or why this is broken, and like the OP mentions here, I'm not seeing any warnings or errors anywhere.

And while we DO have a monorepo, the mobile app is built as a standalone project, and doesn't have duplicate versions of mobx inside the yarn.lock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants