AnsweredAssumed Answered

Bug ArcGIS JS API 3.26 : infinite loop in geometryenginewebworker

Question asked by NicolasGIS on Nov 16, 2018



We noticed a very high CPU utilization of our WebApp built with ESRI JS API 3.26 even when non interacting with it.


Digging into it, it turns out that we included a custom widget which is an iframe application built with React Nativ making "window.parent.postMessage" call to talk to our WebApp in order to send some information.


The problem is that the "esri/geometry/geometryenginewebworker.js" listens to this message as well and do a switch case according to the message sent (case "equals", "disjoint", "within", ...).

Of course, as it is not concerned by this message, it goes to the default case which itself post another message "Unrecognised Action" and there we go, we run into infiinite loop :




Can it be fixed please ? Any worker around that come to your mind ?


Here is a code pen illustrating the problem:

If you remove the postMessage section from the codepen ("window.parent.postMessage("Hello",window.location.origin))", you should see your CPU calming down.