There's a bug when adding a new Pet. Because the appendPet() function just uses count for the new sortOrder value, it will duplicate an existing sortOrder value if any Pets have been deleted since deleting a Pet does not update the order numbers.
To reproduce this problem, display a list of pets, delete any Pet other than the last one, then add a new Pet. You'll see one of the sortOrder numbers is now duplicated.

There's a bug when adding a new Pet. Because the
appendPet()function just usescountfor the newsortOrdervalue, it will duplicate an existingsortOrdervalue if any Pets have been deleted since deleting a Pet does not update the order numbers.To reproduce this problem, display a list of pets, delete any Pet other than the last one, then add a new Pet. You'll see one of the
sortOrdernumbers is now duplicated.