VocaDB / community

https://vocadb.net
0 stars 0 forks source link

Broken sorting #145

Closed kateabr closed 2 years ago

kateabr commented 2 years ago

The following request returns activity entries in a rather peculiar order: https://vocadb.net/api/activityEntries?since=2013-11-26T20%3A11%3A27&editEvent=Created&maxResults=200&fields=Entry&sortRule=CreateDate

<...>
{
  "author": {
    "active": true,
    "groupId": "Regular",
    "mainPicture": {
      "urlSmallThumb": "https://www.gravatar.com/avatar/1e00f3251df15ea4a4fdfc78b046f502?s=40",
      "urlThumb": "https://www.gravatar.com/avatar/1e00f3251df15ea4a4fdfc78b046f502?s=80",
      "urlTinyThumb": "https://www.gravatar.com/avatar/1e00f3251df15ea4a4fdfc78b046f502?s=20"
    },
    "memberSince": "2013-10-09T22:15:48",
    "verifiedArtist": false,
    "id": 916,
    "name": "Kiba"
  },
  "createDate": "2013-11-26T18:11:28Z", // <--
  "editEvent": "Created",
  "entry": {
    "artistString": "HAL feat. 鏡音リン",
    "createDate": "2013-11-26T20:11:28", // <-
    "defaultName": "雨上がり",
    "defaultNameLanguage": "Japanese",
    "entryType": "Song",
    "id": 44077, // <---
    "name": "雨上がり",
    "songType": "Original",
    "status": "Finished",
    "version": 3
  }
},
{
  "author": {
    "active": true,
    "groupId": "Regular",
    "mainPicture": {
      "urlSmallThumb": "https://www.gravatar.com/avatar/1e00f3251df15ea4a4fdfc78b046f502?s=40",
      "urlThumb": "https://www.gravatar.com/avatar/1e00f3251df15ea4a4fdfc78b046f502?s=80",
      "urlTinyThumb": "https://www.gravatar.com/avatar/1e00f3251df15ea4a4fdfc78b046f502?s=20"
    },
    "memberSince": "2013-10-09T22:15:48",
    "verifiedArtist": false,
    "id": 916,
    "name": "Kiba"
  },
  "createDate": "2013-11-26T18:11:28Z", // <--
  "editEvent": "Created",
  "entry": {
    "activityDate": "2019-07-17T00:00:00Z",
    "artistString": "snowy* feat. 鏡音レン",
    "createDate": "2013-11-26T20:11:27", // <-
    "defaultName": "breath of air",
    "defaultNameLanguage": "English",
    "entryType": "Song",
    "id": 44076, // <---
    "name": "breath of air",
    "songType": "Original",
    "status": "Finished",
    "version": 10
  }
}, <...>
ycanardeau commented 2 years ago

Can you please explain a bit more clearly?

kateabr commented 2 years ago

I set sorting to CreateDate, meaning I want the older results before the newer ones. But in this particular case I get two activity entries created at the same time (2013-11-26T18:11:28Z) with inverted order: first goes an entry with a greater id (44077 as opposed to 44076), and the song in the latter entry has been created one second earlier (2013-11-26T20:11:27) than the song in the first one (2013-11-26T20:11:28), meaning they are being returned in a reversed order, which in its turn makes me endlessly loop over the same ten entries.

Additionally, the entry with the lesser id has 2013-11-26T20:11:27 in its create date field, while the activity entry that reflects its creation has 2013-11-26T18:11:28Z -- they differ by one second (I suppose it's because activity entries are created after the changes are made, so not sure whether it is a big deal).

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 7 days.