I have a feature layer hosted in AGOL that I own. I set the permissions to be based on a collab group with a client org (the censored blob in the screenshot). Anyone who is a member of the group should be able to make any edits they see fit including deleting every record in it.
For some reason, when editing the layer in Pro, I can delete a single row, save it, and the changes show up online correctly. I can even select 10, 20, 30 records, and delete them, same thing. It works fine. But if I select all and then use any form of delete function within Pro (Attribute table delete button, Edit tab delete button, Delete Records tool, Delete Features tool, etc etc) It will clear out the Attribute Table and geometry, but it will fail on save. The records remain gone from Pro until I close the project and re-open it. In AGOL, nothing has been deleted. When I have selected all and deleted then replaced everything with new records, it will sometimes let me save, but when I check the layer in AGOL, it has merely appended the new records to the table resulting in duplication and overlap of features.
I have attached a screenshot below that shows most of the permissions. The permissions have not changed since I created the service. Another user created a web map viewer that used the feature layer around the time it stopped letting me delete records en masse. I asked if they had created any Service Definition or WFS or other item that may somehow be causing an issue, but they said no. I know several years ago in AGOL there was weirdness that caused upstream permissions problems when certain types of dependent items were created. I don't think that is the case here, but that user's answer was not the sort of hearty negation I would hope for.
I would just delete the feature layer itself and start over every time there was a mass edit like this, but that breaks several portions of the workflow for some disseminated end users and results in confusion all around.
What am I missing here?
That does seem strange. Have you tried just using Truncate? If you need a "mass delete" option, that's the simplest way to do it.
Thanks for the answer, Josh. I had not tried Truncate. I have actually never used that tool. I just ran it though, and it also gave an odd response. I got an Error 001260 which is normally an unsupported data type error. But it is just polygons nothing exotic. Seems like that should have worked as well. The weirdest part of the error output was that it has the wrong name for my layer. The beginning of my layer is AL for Alabama, but in the error box it is listed with the same name except where it should say "AL..." it says "L4..." Very odd.
Unrelated note: Dude you are so helpful on these community pages. I actually thought to myself before I posted "I bet JCarlson will be the first to answer." That in spite of the fact that I haven't even logged onto the forums in months. Thanks for being willing to jump in and help other folks!
L4 would refer to its position in the table of contents, I think. You don't have an attribute join in place on the layer, do you? Can you try re-adding the layer to your project?
Gotcha, I knew I had seen the L4 thing before, but I couldn't remember when. No joins of any kind. The whole project just has two edit layers, one local and one on AGOL and a handful of supporting data layers (roads etc) that are never edited. It is a simple enough project that I have recreated it several times during this process. That hasn't fixed it though. I went through the process of deleting records 1000 at a time trying different things, and I got the AGOL version to have zero records. It was just such a hack job that I need to know what is going wrong to come up with a long-term fix. I had the "Prevent this feature from being accidentally deleted" toggle turned on in AGOL. I turned it off thinking there might be some unexpected behavior from it. Nothing.
I'm at a loss to explain what is going on here.
Adding to the mystery:
Occasionally...not always...just occasionally...When I delete in Pro and then save, it will tell me the save failed but the records are gone from the attribute table in Pro annnnd the first 1000 records that I had selected will be deleted from the feature service in AGOL. It is like there is some cache keeping more than 1000 records from being passed back and forth between Pro and AGOL at a time.
In the Item details REST, it does say there is a limit of 2000 records on the feature service, but when the duplication happened it went over that by around double. The feature service as originally uploaded had around 1800 records.