-
Notifications
You must be signed in to change notification settings - Fork 447
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
model.getCache throws 'Maximum call stack size exceeded' error #601
Comments
Hmm. This should be an easy fix. I will have to look into this shortly, if I am the one to fix it :) Btw, @threepointone we are more than happy to receive a PR with associated unit test to confirm. If you already know the spot should be an easy fix an |
thanks, I'll try today! |
It looks like every object is tagged with a number of keys, could you explain how you prevent clashes with pre-existing keys? The code in question is this bit here - I'm unsure whether I should remove any key named |
@threepointone Yes, those keys are actually something we were going to change anyways. Essentially what is going on here is that parent key is actually <30>parent where <30> is ascii code 30, record separating character. We are going to go with a $ one here for performance reasons, but for now you can always (which I thought it did) for the first character being that prefix character remove it for the depth recursing. |
@threepointone 0.x / master should have the fix. Could you verify that this fixes the issue for you? If, for whatever reason its not, please paste in the state of the cache before serialization. |
This error still persists. The above script still throws the same error. |
logged just before it executes _copyCache. { users:
{ threepointone:
{ login: 'threepointone',
id: [Object],
avatar_url: 'https://avatars.githubusercontent.com/u/18808?v=3',
gravatar_id: '',
url: [Object],
html_url: 'https://github.com/threepointone',
followers_url: 'https://api.github.com/users/threepointone/followers',
following_url: 'https://api.github.com/users/threepointone/following{/other_user}',
gists_url: 'https://api.github.com/users/threepointone/gists{/gist_id}',
starred_url: 'https://api.github.com/users/threepointone/starred{/owner}{/repo}',
subscriptions_url: 'https://api.github.com/users/threepointone/subscriptions',
organizations_url: 'https://api.github.com/users/threepointone/orgs',
repos_url: 'https://api.github.com/users/threepointone/repos',
events_url: 'https://api.github.com/users/threepointone/events{/privacy}',
received_events_url: 'https://api.github.com/users/threepointone/received_events',
type: 'User',
site_admin: false,
name: [Object],
company: null,
blog: null,
location: 'Bangalore, India',
email: 'threepointone@gmail.com',
hireable: true,
bio: null,
public_repos: 89,
public_gists: 18,
followers: 184,
following: 3,
created_at: '2008-07-29T12:17:53Z',
updated_at: '2015-11-26T10:12:59Z',
'\u001ekey': 'threepointone',
'\u001eparent': [Circular],
'\u001eversion': 1,
'ツabsolutePath': [Object],
'$size': 202 },
'\u001ekey': 'users',
'\u001eparent': [Circular],
'ツabsolutePath': [ 'users' ],
'$size': 202,
'\u001eversion': 1 },
'\u001eversion': 1,
'$size': 202 } |
Specifically, it looks like some keys have |
@threepointone You should re-pull master. That was during a transition of performance changes. We went from an untype-able character, to a type-able character. We found huge performance wins both on device and node by going from variable keys to static (using I believe if you repull this problem should not persist. |
This usually happens after making a request to an HttpDataSource. I have a standalone reproducible case (pardon the es6/7) -
I see that the problem is happening in a _copyCache function, where it's recursively going through its internal cache, but following a
parent
key (and others) resulting in a circular reference?The text was updated successfully, but these errors were encountered: