atomic-server icon indicating copy to clipboard operation
atomic-server copied to clipboard

Duplicated results in collection when sorted

Open rasendubi opened this issue 3 years ago • 3 comments

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):

rasendubi avatar Jun 05 '22 01:06 rasendubi

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?

joepio avatar Jun 05 '22 07:06 joepio

I was able to reproduce it on atomicdata.dev:

  1. Create class (e.g., https://atomicdata.dev/classes/test-class)
  2. Edit description after creation
  3. Sort classes by description: https://atomicdata.dev/classes?sort_by=https%3A%2F%2Fatomicdata.dev%2Fproperties%2Fdescription
  4. 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.

rasendubi avatar Jun 05 '22 08:06 rasendubi

Thank you! I'll dive into it.

joepio avatar Jun 05 '22 08:06 joepio