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

- Updates are being mocked and applied (should be visible)
- When toggling "off" layer ship (visibility false) => A clear message is created (console output)
- The delete is processed BUT not removed from the map, layer will be hidden
- 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