hekuli / swiftdata-test

5 stars 0 forks source link

Sort Order Bug #1

Open DaveBatton opened 6 months ago

DaveBatton commented 6 months ago

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.

image
DaveBatton commented 6 months ago

But also, thanks for posting this!

hekuli commented 5 months ago

@DaveBatton Oh yes, nice find! Thank you for pointing this out. Will fix when I get time.