<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Bug ArcGIS JS API 3.26 : infinite loop in geometryenginewebworker in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-arcgis-js-api-3-26-infinite-loop-in/m-p/504471#M46836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We noticed a very high CPU utilization of our WebApp built with ESRI JS API 3.26 even when non interacting with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the "esri/geometry/geometryenginewebworker.js" listens to&amp;nbsp;this message as well and&amp;nbsp;do a switch case according to the message sent (case "equals", "disjoint", "within", ...).&lt;/P&gt;&lt;P&gt;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 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="429737" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/429737_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="429738" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/429738_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can it be fixed please ? Any worker around that come to your mind ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code pen illustrating the problem:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/anon/pen/zMELJK"&gt;https://codepen.io/anon/pen/zMELJK&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you remove the postMessage section from the codepen ("window.parent.postMessage("Hello",window.location.origin))", you should see your CPU calming down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Nov 2018 15:26:32 GMT</pubDate>
    <dc:creator>NicolasGIS</dc:creator>
    <dc:date>2018-11-16T15:26:32Z</dc:date>
    <item>
      <title>Bug ArcGIS JS API 3.26 : infinite loop in geometryenginewebworker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-arcgis-js-api-3-26-infinite-loop-in/m-p/504471#M46836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We noticed a very high CPU utilization of our WebApp built with ESRI JS API 3.26 even when non interacting with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the "esri/geometry/geometryenginewebworker.js" listens to&amp;nbsp;this message as well and&amp;nbsp;do a switch case according to the message sent (case "equals", "disjoint", "within", ...).&lt;/P&gt;&lt;P&gt;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 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="429737" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/429737_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="429738" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/429738_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can it be fixed please ? Any worker around that come to your mind ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code pen illustrating the problem:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/anon/pen/zMELJK"&gt;https://codepen.io/anon/pen/zMELJK&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you remove the postMessage section from the codepen ("window.parent.postMessage("Hello",window.location.origin))", you should see your CPU calming down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2018 15:26:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-arcgis-js-api-3-26-infinite-loop-in/m-p/504471#M46836</guid>
      <dc:creator>NicolasGIS</dc:creator>
      <dc:date>2018-11-16T15:26:32Z</dc:date>
    </item>
  </channel>
</rss>

