<?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 Re: Bug with Filter in StreamLayer with Custom WebSocket Url + ArcGIS JS API 4.25 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-with-filter-in-streamlayer-with-custom/m-p/1230969#M79300</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/632941"&gt;@Koob&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We added the custom websocket input for StreamLayers really just for simple cases, with GeoEventSource for more fully featured services. Note that as part of&amp;nbsp;&lt;A href="https://github.com/mmgeorge/node-stream-service" target="_blank" rel="noopener"&gt;mmgeorge/node-stream-service: Example for connection a custom WebSocket stream service to the 4.x ArcGIS JS API (github.com)&lt;/A&gt;, there's no logic for setting geometryDefinition or definitionExpression specified. We probably need to add to the known limits that this is unsupported for custom websockets (basically undefined behavior currently -- FYI, in some cases filter can actually be a string which is probably why you are seeing that code block not make any sense).&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is your use case here? Are you planning on changing the definitionExpression / geometryDefinition at runtime, and your custom websocket server can handle this?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 20:00:05 GMT</pubDate>
    <dc:creator>mgeorge</dc:creator>
    <dc:date>2022-11-11T20:00:05Z</dc:date>
    <item>
      <title>Bug with Filter in StreamLayer with Custom WebSocket Url + ArcGIS JS API 4.25</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-with-filter-in-streamlayer-with-custom/m-p/1230885#M79297</link>
      <description>&lt;P&gt;I've got a simple custom websocket server that adds a user to a specific websocket group during the handshake.&lt;/P&gt;&lt;P&gt;Using a constructor similar to the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;new StreamLayer({
   webSocketUrl: "wss://somewebsocket",
   definitionExpression: "test=1",
   ...
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;even though my server is responding to the handshake with the correct filter, as seen below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Koob_0-1668175376468.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55814i054DF89979927EC4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Koob_0-1668175376468.png" alt="Koob_0-1668175376468.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The stream layer is logging the below message:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;[esri.layers.graphics.sources.connections.WebSocketConnection]&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;OL class=""&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;t&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;SPAN class=""&gt;name&lt;/SPAN&gt;: &lt;SPAN class=""&gt;'websocket-connection'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;details&lt;/SPAN&gt;: &lt;SPAN class=""&gt;undefined&lt;/SPAN&gt;, &lt;SPAN class=""&gt;message&lt;/SPAN&gt;: &lt;SPAN class=""&gt;"Tried to set filter, but server doesn't support it"&lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;OL class=""&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;details&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;undefined&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;message&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;"Tried to set filter, but server doesn't support it"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;name&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;"websocket-connection"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;[[Prototype]]&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;C&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I debugged the minified&amp;nbsp;&lt;SPAN class=""&gt;WebSocketConnection class and found that the code is doing something like: config.filter === response.filter.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;javascript does object comparison by ref, so simply checking if the response object does not equal config object will never succeed.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 11 Nov 2022 14:07:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-with-filter-in-streamlayer-with-custom/m-p/1230885#M79297</guid>
      <dc:creator>Koob</dc:creator>
      <dc:date>2022-11-11T14:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with Filter in StreamLayer with Custom WebSocket Url + ArcGIS JS API 4.25</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-with-filter-in-streamlayer-with-custom/m-p/1230969#M79300</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/632941"&gt;@Koob&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We added the custom websocket input for StreamLayers really just for simple cases, with GeoEventSource for more fully featured services. Note that as part of&amp;nbsp;&lt;A href="https://github.com/mmgeorge/node-stream-service" target="_blank" rel="noopener"&gt;mmgeorge/node-stream-service: Example for connection a custom WebSocket stream service to the 4.x ArcGIS JS API (github.com)&lt;/A&gt;, there's no logic for setting geometryDefinition or definitionExpression specified. We probably need to add to the known limits that this is unsupported for custom websockets (basically undefined behavior currently -- FYI, in some cases filter can actually be a string which is probably why you are seeing that code block not make any sense).&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is your use case here? Are you planning on changing the definitionExpression / geometryDefinition at runtime, and your custom websocket server can handle this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 20:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-with-filter-in-streamlayer-with-custom/m-p/1230969#M79300</guid>
      <dc:creator>mgeorge</dc:creator>
      <dc:date>2022-11-11T20:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with Filter in StreamLayer with Custom WebSocket Url + ArcGIS JS API 4.25</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-with-filter-in-streamlayer-with-custom/m-p/1231699#M79329</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/300815"&gt;@mgeorge&lt;/a&gt;, thanks for the response.&lt;/P&gt;&lt;P&gt;Currently I am using the `definitionExpression` to send the initial filter data to my websocket server to join specific groups.&lt;/P&gt;&lt;P&gt;for example: I have two tenants, tenant 1 and tenant 2.&lt;/P&gt;&lt;P&gt;tenant 1 should not see events for tenant 2.&lt;/P&gt;&lt;P&gt;within my StreamLayer definitionExpression I am setting some filter for example `tenant = tenant1`&amp;nbsp;&lt;/P&gt;&lt;P&gt;this gets sent down to my server during the initial handshake as part of the filter, which I then use to join a azure webpubsub group. which works as expected.&lt;/P&gt;&lt;P&gt;Just thought i'd point out the bug.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 14:01:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bug-with-filter-in-streamlayer-with-custom/m-p/1231699#M79329</guid>
      <dc:creator>Koob</dc:creator>
      <dc:date>2022-11-15T14:01:11Z</dc:date>
    </item>
  </channel>
</rss>

