Bug? ArcGIS REST API service layer operation extractChanges returns adds as updates

10-12-2020 11:47 AM
New Contributor II

I've been playing with a python tool to sync our local featureclasses with their corresponding service layers. The whole thing kind of hinges on the extractChanges operation and services' ChangeTracking capability working as advertised. By and large, it works great. There seems to be a catch (read: bug), though: new features that were created or edited in AGOL web viewer are returned as updates instead of adds. 

I think this bug might point to a fundamental difference in the way that the AGOL web viewer handles editing compared to Collector. In the web viewer, every single edit operation is treated like an update; there's no "save changes" button because every single change is streamed to the service as it happens. In Collector, all the changes made during editing / creation are pushed to the service all at once when you tap the submit button.

This means that, in the AGOL web viewer, at the moment you create a new feature the dateCreated and dateLastUpdate fields are identical. If you enter even a single attribute, the dateLastUpdate field is changed. By contrast, in Collector, new features are pushed to AGOL fully formed; Collector doesn't stream individual attribute updates, it only uploads adds/updates to AGOL when you tap the submit button, then sends it all at once. 


I kinda suspect that the extractChanges operations populates the adds by querying the layer for features where dateCreated == dateLastUpdate (or something to that effect). Because of this difference in behavior between AGOL / Collector, new features created in Collector are correctly returned as adds and new features created in AGOL are returned as updates. Furthermore, if a new feature-- originally created in Collector-- is edited in the AGOL web viewer, it's returned as an update. 

Feature creation / editing in ArcPro works the same way as AGOL web viewer, apparently. Syncing a replica from ArcMap works like Collector. Go figure. 

 I've submitted a bug report with steps to replicate this. I would love for someone to please tell I'm wrong and that I've overlooking something glaring. Or maybe, ESRI, you should implement a save changes button for the feature creation/editing popup in AGOL web viewer a la Collector and populate adds with a query that doesn't suck. 

0 Replies