Select to view content in your preferred language

4.32 - ApplyEdits BUG - When Layer is HIDDEN (Codepen added)

321
2
03-12-2025 06:58 AM
michaelkdev
Regular Contributor

Hi esri developers,

There's a bug with applyEdits when Layer X is hidden. When toggling off a layer -> we send a delete all to ArcGIS Api using applyEdits with queryFeatures (all). The delete all functionality is working perfectly when the layer is visible. However, when the layer is toggled off (visibility = false), the clear all will delete all features in memory (arcgis side) but it does not remove the graphics from the map (rendering). Time between processed in memory and renderer on the map is not correct. (Callback issue)

Added a codepen to reproduce this issue.
https://codepen.io/michaelk95/pen/azbLMNK?editors=1000

michaelkdev_0-1741787459224.png

  1. Updates are being mocked and applied (should be visible)
  2. When toggling "off" layer ship (visibility false) => A clear message is created (console output)
  3. The delete is processed BUT not removed from the map, layer will be hidden
  4. When toggling "on" the layer ship -> a blue rectangle will appear, but arcgis will say there are no features active!

This is quite a big issue and should be fixed?

Thanks in advance

 

Gr

Michael

 

 

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

I can reproduce the behavior you're describing and will inform you as soon as we have a fix in place. However, I'm curious about why you're using a client-side feature layer in this case. It seems like you're frequently updating features. The StreamLayer, on the other hand, is optimized for handling data that updates at a high frequency.

michaelkdev
Regular Contributor

Thanks for the investigation! We're also using the feature layer for sporadic updates, as I believe it's the perfect fit for these layers. This issue will still occur with them, I assume. In any case, we'll also look into the stream layer for frequently updating features. Thanks!

0 Kudos