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

ObservableSet.intersection triggers "Maximum call stack size exceeded" stack overflow #3919

Closed
travismfrank opened this issue Sep 5, 2024 · 2 comments · Fixed by #3921 or #3922 · May be fixed by Usama-Tahir-1935/Reactivities#3
Closed
Labels

Comments

@travismfrank
Copy link

Intended outcome:

Calling the newly implemented ObservableSet.intersection with another ObservableSet as the argument causes a stack overflow error. This is because an ObservableSet argument passes isES6Set, thus calling intersection on that set with the first set as the argument. Repeat ad infinitum until V8 decides it's had enough.

observableSet.intersection(otherObservableSet) should just work.

Actual outcome:

"Maximum call stack size exceeded" in Chrome. Stack overflow.

How to reproduce the issue:

const foo = observable.set(['a', 'b', 'c']);
const bar = observable.set(['c', 'd', 'e']);

const shared = foo.intersection(bar);

Here's an interactive version, just click the button.

Versions

mobx@6.13.1

@urugator
Copy link
Collaborator

urugator commented Sep 6, 2024

Possibly broken by https://github.com/mobxjs/mobx/pull/3893/files . It introduced new isPlainES6Map, but not isPlainES6Set. Previously isES6Set yielded false for observable set.

@urugator
Copy link
Collaborator

urugator commented Sep 7, 2024

Thank you for the report, should be fixed in mobx@6.13.2

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