Duplicated results in collection when sorted
I sometimes see duplicated data in a collection when I add sort_by parameter (or click sorting buttons in the atomic-data-browser). Depending on the parameter I sort by, I see more or less duplicates. And I usually see more duplicates of resources which sorted-by parameter I edited more. Once I see a duplicate, it's always there.
Restarting server with --rebuild-index fixes the issue. So this likely a bug with maintaining the index (e.g., not deleting previous entries or something).
Version: latest master (f36e2b066bd0b55001de18a9f0971505dbeb15f9)
Example
Unsorted collection:

Sorted by name (notice test path chan duplication):

Sorted by last-visited (lots of duplicates):

Thanks for the detailed bug report! ~~Did it happen locally as well as on atomicdata.dev collections?~~ Seems like it, I kind of assumed it was on atomicdata.dev because the parent was there.
I'm trying to replicate this, but I fail to do so. Could you be more specific about which collection, or perhaps the datatypes of the properties?
I was able to reproduce it on atomicdata.dev:
- Create class (e.g., https://atomicdata.dev/classes/test-class)
- Edit description after creation
- Sort classes by description: https://atomicdata.dev/classes?sort_by=https%3A%2F%2Fatomicdata.dev%2Fproperties%2Fdescription
- Notice test class is duplicated
Locally, this happens for a similar isA-filtered collection:
{
"https://atomicdata.dev/properties/collection/property": "https://atomicdata.dev/properties/isA",
"https://atomicdata.dev/properties/collection/value": "http://localhost/classes/Workspace",
"https://atomicdata.dev/properties/isA": ["https://atomicdata.dev/classes/Collection"]
}
The issue happens when I sort by either http://localhost/properties/lastVisited (timestamp) or https://atomicdata.dev/properties/name (string) so I assume datatype is not relevant.
Thank you! I'll dive into it.