Skip to content

toJSON or JSON.stringify is unresponsive #415

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

Closed
adefokun opened this issue Mar 8, 2017 · 7 comments
Closed

toJSON or JSON.stringify is unresponsive #415

adefokun opened this issue Mar 8, 2017 · 7 comments

Comments

@adefokun
Copy link

adefokun commented Mar 8, 2017

When I call toJSON or JSON.stringify in Javascript SDK the application becomes unresponsive.

@andrewimm
Copy link
Contributor

Can you provide code that reproduces this? Also, information on the environment would be helpful (node.js vs browser, which version)

@adefokun
Copy link
Author

adefokun commented Mar 8, 2017

Thank you.

        Parse.Cloud.run('getAttendees', {},{
            success: function(d){ 
                var data = JSON.stringify(d);
            },
            error: function(error){
            }
        });

"parse-server": "^2.3.6",
"express": "^4.13.4",
"node": "4.4",

@adefokun
Copy link
Author

adefokun commented Mar 8, 2017

No errors are indicated but the application becomes unresponsive, every time.

@adefokun
Copy link
Author

adefokun commented Mar 9, 2017

I think it goes into an infinite loop.

@adefokun
Copy link
Author

I notice there are recursive loops because the server now automatically include all pointers. How can this functionality be disabled so that I can manually include pointers that I want included in a query?

@adefokun
Copy link
Author

I closed the issue thinking the problem was with parse-server. I noticed that the details of pointers in arrays are included by default, I did not have to use "include" and the server actually returned pointers, but the SDK populated them with details.

var interestAreasQuery = new Parse.Query("InterestArea");
interestAreasQuery.find().then(function(result){
   console.log(result);
}}

IntrestedArea has an interest key, which is an array of pointers. The details of each pointer is included. And because interest has a pointer interestedArea, the pointer details is also included and the leads to infinite loop. In a situation like this JSON.stringify(result) renders the application unresponsive.

@adefokun adefokun reopened this Mar 11, 2017
@stale
Copy link

stale bot commented Feb 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

4 participants