AnsweredAssumed Answered

Circular reference in a query items request

Question asked by iorbeTracasa on Oct 28, 2015
Latest reply on Oct 29, 2015 by iorbeTracasa

I am working on a custom widget. One of the things I need to do is to query a group item from AGOL. To do this I use the query items methods as below with the required parameters.



When I work authenticated with an enterprise login, it all worked as it was expected. But when I authenticated with an AGOL user I receive an error: Uncaught RangeError: Maximum call stack size exceeded. It was that when the request that is shown above was done, ArcGIS javascript API was generating an object with a circular reference and the widget crashes. The request is a search (sharing/rest/search) request and the parameters are

the following: f=json&q=group%3A"6264b2c574414393886a3bcb43dd8fba"&sortField=modified&sortOrder=DESC&num=100&token=<token>


If we look at the network tab of the developers tools, the response to this request is correct. So, that this response suffers some changes before arriving to the callback function. Once inside the callback function the data parameter has been modified. Inside each result has a portal object, that contains a user object inside, that references the previous portal oblect again and so on.


This only happens when you are logged in with an AGOL user. It might also be worth mentioning that in our case all AGOL items are inside an enterprise site.


Has this happen to any of you? Have you any solution besides deleting the circular reference objects?


Thanks in advance