Territories Sort Order Bug?

CityStrides Profile Link

Message

When I sort my territories by [distance] From Home, Increasing, my 2nd page of results is almost identical to the 1st.

First page, click Show on all:

Then I click on next page, and again click Show on all territories:

and only like 2 new ones have appeared. Definitely not 12 new ones.

Is this a bug? Or is there some territory math I’m not understanding?

When I click Show for a territory the map zooms in to that territory. If you click them one by one you should see a new one for each click.

Yeah, so that’s what I did, on the entire second page I clicked show, it zooms in, one by one, to all the same territories that I’d already shown on page 1.

Strange! If you don’t click any territories at all on page 1, just go to page 2 and Show one, then Hide, show next etc. Do they show the same one?

Do you get similar weirdness when paging through other sorting options?

Your first screenshot cuts off details on the left side, but it seems like these sizes are different from page to page. :thinking: I’m wondering if the Show button’s “zoom/pan map to Territory” thing isn’t working on page two…

You can see (nearly) that territories “1.791 km^2” and 1.719 km^2" (not a bug, coincidental numbers) appear on both pages of results, when I sort by “From Home” ASC. Let me try to check the other sort options.

Edit: I don’t see any obvious sort issues with other options. Keep in mind it’s very hard to tell visually, because you’re not zooming all over the entire world. I haven’t seen any issues though, by looking at the list.

Fixed screenshots:

and

The list isn’t identical, no, but tons of repeats.

Ah, ok, I found it… I’ve made this mistake before, as well. :grimacing:
I do think it’s possible to see this issue with the activities count sorting (ascending).
This will be sorted out in the next release.

The issue is that when there are multiple pages of records with the same value it’s sorting on, the database just kinda does whatever, resulting in some records appearing on multiple pages. The fix is to add a backup/fallback order on some field that’s definitely unique e.g. ID. In your case, it’s repeating Territories because you have 34 Territories that are “0” distance from your default city.