-
-
Notifications
You must be signed in to change notification settings - Fork 642
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
RangeError:Maximum call stack size exceeded #1268
Comments
The code that gets into this error is the new rangeset implementation used for live queries in dexie 3.1.0-alpha. I don't think it's related to anything else than the rangeset code itself. I hope it's a bug that could be tracked down if we found a way to reproduce it. The code is rangeset.ts. |
Yeah, if I find a way to reproduce it I'll definitely pass it along. Sorry again I don't have more for you :( But figured you'd want to know about it just in case. |
I'm getting this multiple times a day during development of this - source here. I ran the app all last night, no error, then today while i was running it, i got the error three or four times. I get the feeling the likelihood of this error occurring increases with activity to/from the db, i'm on Happy to help isolate it and/or produce a repro if I can - right now the stacktrace is pretty long and vague - I'm not certain even which query it was executing when it occurs... |
Thanks @staff0rd for sharing code that could hopefully be to nail down the issue. I'm quite confident we will find the issue and solve it eventually. Right now I have limited time to look into it in April/May (until Dexie Cloud beta is out). Anyone brave enough to dive into this??? My gut feeling is that the issue lies in RangeSet.ts in one of these functions: addRange(), mergeRanges() or rebalance().
Since @staff0rd's app may decrease the use of |
I am still getting it now on the latest commit, tho, it may be difficult for others to use that code to produce it - the app runs a bunch of statemachines in the background which also make calls to dexie as they need to. I'll see if I can dive into it a bit on my own, tho i'm new to dexie. The latest time it threw (a few minutes ago) has only a single reference to
I'll see if I can catch it before it throws and inspect the branches. |
As another data point: I'm seeing this in |
The only calls I'm using are:
|
Thanks @staff0rd I think I'll try to stress Rangeset with random values to see if I can reproduce. |
Not able to reproduce it. Trying with your requests and filling db with 100,000 of rows with random ids and index values. I'm wondering whether it could occur only if the key is a mutable key (array or binary key) and is mutated so that the binary tree gets confused? Does any of your indexed properties (id,collector_number,name,oracle_id,set_code,queried) contain mutable keys such as array, ArrayBuffer, UInt8Array etc? |
Adding more info to this thread to hopefully help out. Here's the error captured in Sentry with a stacktrace: https://sentry.io/share/issue/f0666217026d4a448adc153d9768595f/ Happened for only one user (out of hundreds) so far on: Chrome 89.0.4389 / Windows 10 All indexed keys are either integer or string. |
Only strings and (auto-incremented PK) integers indexed in our application as well. We also have whatever |
@dfahlander negative. Just strings and I think queried is a date or Unix timestamp/number |
I've reproduced it in PR #1290. Added tests for RangeSet (had them before in another repo) and also found a set of ranges that reproduces this issue. Had to create 10,000 sets with 20 random ranges each to find one or two crashing combinations. One of those are defined in a repro test. It generates a circular tree for some reason. Will try fixing it soon. |
an issue in rebalance made the tree corrupt in certain conditions. Will release new version soon and looking forward for feedback from you all 😉 |
Except from crashing, this bug did also lead to infinite loops when traversing a currupt and circular referencing tree. |
i really appreciate the tree-rotation ascii diagram |
@dfahlander Out of curiosity, could this have resulted an error something like the following?
I see this error sometimes as well, but don't currently have a trace available. |
No. That error is a result of having non-clonable data in the object to store. Functions, promises and some other types must not be part of the object being stored. This limitation lies in the structured cloning algorithm implemented in IndexedDB. |
@dfahlander That makes sense. I've been somewhat befuddled about this error since all of this data should be pure JSON. So I'm not really certain where these other data-types are coming from. I'm actually wondering if Zone.js is patching the data erroneously somehow. |
Dexie 3.1.0-alpha.10 is released just now. If you'd have a chance to give me a comment in this issue after having upgraded and run it for a while, that would be terrific! :) Thanks! |
Still no new reports, over 4,000 sessions. |
I've been using |
Possibly related to #589 since I do use Ionic & Angular:
I don't have a whole lot of info on this since the stack trace is not very descriptive unfortunately. I saw it once and not since.
The text was updated successfully, but these errors were encountered: