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

Details of pointers in arrays are included by default causing infinite loop #3619

Closed
adefokun opened this issue Mar 11, 2017 · 5 comments
Closed

Comments

@adefokun
Copy link

I noticed that the details of pointers in arrays are included by default, I do not have to use "include".

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.

I should be able to opt to include the keys that I want.

Parse Server version: ^2.3.6

@flovilmart
Copy link
Contributor

Can you provide the server logs please?

@adefokun
Copy link
Author

Please see below;

log

@flovilmart
Copy link
Contributor

CAN you provide the server logs of the request? Not the client state please?

@adefokun
Copy link
Author

[{"title":"Science and Technology","createdAt":"2016-08-30T14:44:10.565Z","updatedAt":"2016-08-31T12:52:31.571Z","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"btwqSxvLVo"},{"__type":"Pointer","className":"Interest","objectId":"Bwl7H7dDUm"},{"__type":"Pointer","className":"Interest","objectId":"rjGMmAdXnm"}],"objectId":"0TOe8RJQ05","__type":"Object","className":"InterestArea"},{"createdAt":"2016-08-30T14:43:23.577Z","updatedAt":"2016-08-31T12:52:30.776Z","title":"Human Capital Development","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"Oq6hKF7o60"},{"__type":"Pointer","className":"Interest","objectId":"eVxQxRftD5"},{"__type":"Pointer","className":"Interest","objectId":"aTFf1tSJNc"},{"__type":"Pointer","className":"Interest","objectId":"0rNbwbACjK"}],"objectId":"KoXFJrly6o","__type":"Object","className":"InterestArea"},{"createdAt":"2016-08-30T14:44:01.674Z","updatedAt":"2016-08-31T12:52:32.758Z","title":"Energy (Oil & Gas/Power)","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"L31MkAqZnW"},{"__type":"Pointer","className":"Interest","objectId":"aoM4j3s8In"},{"__type":"Pointer","className":"Interest","objectId":"sc5nj1PItL"},{"__type":"Pointer","className":"Interest","objectId":"vVezhz89A9"},{"__type":"Pointer","className":"Interest","objectId":"PnwFRy2Ytt"},{"__type":"Pointer","className":"Interest","objectId":"rLTP9GcZLT"}],"objectId":"LxH8yELBHo","__type":"Object","className":"InterestArea"},{"updatedAt":"2016-08-31T12:52:29.591Z","title":"SME, Finance and Financial Market","createdAt":"2016-08-30T14:42:47.635Z","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"TAeBcYw3KG"}],"objectId":"PeNNFzpSjo","__type":"Object","className":"InterestArea"},{"createdAt":"2016-08-30T14:43:03.086Z","updatedAt":"2016-08-31T12:52:32.340Z","title":"Trade, Investment and Competitiveness","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"Yg7bfAbFjW"},{"__type":"Pointer","className":"Interest","objectId":"MyzhiFyLtG"},{"__type":"Pointer","className":"Interest","objectId":"ANDTyZWf3k"}],"objectId":"T3TuQ1G9YH","__type":"Object","className":"InterestArea"},{"createdAt":"2016-08-30T14:43:52.340Z","updatedAt":"2016-08-31T12:52:21.572Z","title":"Real Sector","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"83ZT2bcen8"},{"__type":"Pointer","className":"Interest","objectId":"jB8u5kh6ht"}],"objectId":"hcTHEHZlTF","__type":"Object","className":"InterestArea"},{"updatedAt":"2016-08-31T12:52:23.123Z","title":"Agriculture and Food Security","createdAt":"2016-08-30T14:43:42.617Z","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"u7DSpXTE7w"},{"__type":"Pointer","className":"Interest","objectId":"MX31sJFQQ0"},{"__type":"Pointer","className":"Interest","objectId":"gtRxz7ZacF"}],"objectId":"swBZsJgTZI","__type":"Object","className":"InterestArea"},{"title":"Governance and Institutions","createdAt":"2016-08-30T14:43:14.495Z","updatedAt":"2016-08-31T12:52:33.159Z","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"N5RHtfTOUx"},{"__type":"Pointer","className":"Interest","objectId":"HnZeUUyOo6"},{"__type":"Pointer","className":"Interest","objectId":"R5vUcDYXBj"}],"objectId":"uPZy9zp1Vc","__type":"Object","className":"InterestArea"},{"title":"Environmental Sustainability","createdAt":"2016-08-30T14:42:28.340Z","updatedAt":"2016-08-31T12:52:31.970Z","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"T7Fxgga9J2"},{"__type":"Pointer","className":"Interest","objectId":"zdI1R6ikvL"},{"__type":"Pointer","className":"Interest","objectId":"5l1uw9tmhX"},{"__type":"Pointer","className":"Interest","objectId":"sUZVerb1L1"}],"objectId":"z9d3xIpzdR","__type":"Object","className":"InterestArea"},{"createdAt":"2016-08-30T14:43:33.748Z","updatedAt":"2016-08-31T12:52:28.187Z","title":"Infrastructure","organiser":{"__type":"Pointer","className":"Organiser","objectId":"GZ3DLaD8ZZ"},"event":{"__type":"Pointer","className":"Event","objectId":"VjEGX0z7Sh"},"interests":[{"__type":"Pointer","className":"Interest","objectId":"FbKk1HkzgU"},{"__type":"Pointer","className":"Interest","objectId":"DaU4dB3H9U"}],"objectId":"zwWedbZ8Do","__type":"Object","className":"InterestArea"}]

The log looks OK but why does it change in the client, calling JSON.stringify() on it from the client leads to infinite loop. How can I access the raw response from the client?

@adefokun
Copy link
Author

I am closing this since the problem seems to be from the SDK.

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

2 participants