<?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 Socket Closed with Enigma in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Socket-Closed-with-Enigma/m-p/2506953#M21853</link>
    <description>&lt;P&gt;&lt;SPAN&gt;We have a bit of code in javascript using the enigma engine to obtain the first sheet id of an app. It works well in many of the installations.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, on one environment it fails with a socket closed exception. with a hardcoded sheet id the graphics load and all of the rest apis work as well.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The problem occurs when trying to instantiate the enigma engine in this bit of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;async function createEnigmaAppSession(schema, appId, identity, params) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;const session = enigma.create({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;schema,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;url: `wss://${TENANT}/app/${appId}/identity/${identity}?${params}`&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;handleDisconnect(session);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;const enigmaGlobal = await session.open();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;const enigmaApp = await enigmaGlobal.openDoc(appId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return [session, enigmaApp];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have triple checked the Content Security Policy with the server name and frameAncestors checked. the web integration id and api key and the private key seems to be ok.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MirelaPopovici_0-1740172787403.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177780i158F09DD92D6A196/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MirelaPopovici_0-1740172787403.png" alt="MirelaPopovici_0-1740172787403.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MirelaPopovici_1-1740172838988.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177781i63A94AD2560DB79A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MirelaPopovici_1-1740172838988.png" alt="MirelaPopovici_1-1740172838988.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2025 21:22:00 GMT</pubDate>
    <dc:creator>MirelaPopovici</dc:creator>
    <dc:date>2025-02-21T21:22:00Z</dc:date>
    <item>
      <title>Socket Closed with Enigma</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Socket-Closed-with-Enigma/m-p/2506953#M21853</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We have a bit of code in javascript using the enigma engine to obtain the first sheet id of an app. It works well in many of the installations.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, on one environment it fails with a socket closed exception. with a hardcoded sheet id the graphics load and all of the rest apis work as well.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The problem occurs when trying to instantiate the enigma engine in this bit of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;async function createEnigmaAppSession(schema, appId, identity, params) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;const session = enigma.create({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;schema,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;url: `wss://${TENANT}/app/${appId}/identity/${identity}?${params}`&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;handleDisconnect(session);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;const enigmaGlobal = await session.open();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;const enigmaApp = await enigmaGlobal.openDoc(appId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return [session, enigmaApp];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have triple checked the Content Security Policy with the server name and frameAncestors checked. the web integration id and api key and the private key seems to be ok.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MirelaPopovici_0-1740172787403.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177780i158F09DD92D6A196/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MirelaPopovici_0-1740172787403.png" alt="MirelaPopovici_0-1740172787403.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MirelaPopovici_1-1740172838988.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/177781i63A94AD2560DB79A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MirelaPopovici_1-1740172838988.png" alt="MirelaPopovici_1-1740172838988.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 21:22:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Socket-Closed-with-Enigma/m-p/2506953#M21853</guid>
      <dc:creator>MirelaPopovici</dc:creator>
      <dc:date>2025-02-21T21:22:00Z</dc:date>
    </item>
  </channel>
</rss>

