Too-deeply-nested

Could someone please tell me what is generating this error:

2016-08-30 15:28:02 UTC+12 [Device] ERROR: skipped too-deeply-nested data

I’m passing data between device to agent to device and am seeing this on one imp with regularity. Is it the serialiser that is used to pass object data between them?

You hit that if your object is more than 10 levels of nesting deep; it’s arbitrary but affects stack utilization so we put a limit on it we didn’t think people would hit.

Are you using stuff that deep, or is it something runaway that you aren’t aware of?

Hmmm, not sure, but your answer is helpful. I’ll investigate further

I’m starting to hit situations where the device generates runtime errors because it can’t find objects such as “imp” or “hardware”. Should I also assume that this is related to the nesting limit too?

Instead of:

`do <- {
  some = {
    thing = function(a,b,c){
      do.some.thingelse(a,b,c)
    }
  }
}
do.some.thing(1,2,3)
`

I’ve been able to relive the pressure on the stack by doing the following:

`do <- {
  some = {
    thing = function(a,b,c){
      imp.wakeup(0,function() { do.some.thingelse(a,b,c) }.bindenv(this))
    }
  }
}
do.some.thing(1,2,3)
`

Whoops, getting this now: “Native stack overflow”. I might be overdoing things a bit.

If you have some example code then we can take a look at what’s happening.