A group needs to be deleted that was referenced by an old profile. This profile was deleted, but an error message saying that the group is referenced still shows up when trying to delete the group. After a synch, the group could be "deleted" without an error, but after another synch, the group reappears.
I was not able to duplicate the first part of the bug. I added a profile to a test application and added a group to it. I then deleted the profile. I was able to delete the group without getting the warning described. Nonetheless, I added a check in the code to not include deleted profiles in the list of references when deleting groups in revision 911.
The sync was failing to delete the group because of a bug in the GroupTypeDAO.isReferenced() function. The query failed to include the application id, so if any application had a subgroup with the same id, the function would say that the group was referenced and the sync would return a conflict.
Fix checked in for this part of the bug in revision 912.