cyrusae / highlighter-public

Next.js/SQLite app for qualitative coding and content analysis; prototype currently in (sometimes) working alpha.
Other
3 stars 0 forks source link

Fix issues with next/previous queries #25

Closed cyrusae closed 2 years ago

cyrusae commented 2 years ago

Currently, reader.ts isn't actually retrieving the sID belonging to the statements with the min/max lastSeenAsInt values. I don't know why. I have confirmed that the SQL query is returning the values it's supposed to, the subsequent Prisma one just seems to drop the ball in ways I do not understand.

cyrusae commented 2 years ago

Route in question

cyrusae commented 2 years ago

Well, I've confirmed it's that Prisma literally just isn't sending the query.

Example:

output of 'big' raw query:
[ { 'MAX(lastSeenAsInt)': 1650198081516 } ]
output of 'small' raw query:
[ { 'MIN(lastSeenAsInt)': 1 } ]

nextStatement searches for the one with the MIN(lastSeenAsInt) value returned. And yet,

found as prevStatement:
{
  statementID: 1123,
  content: 'Example statement #1, which I am putting some text in for display.',
  plainText: null,
  coded: false,
  updatedAt: 2022-04-17T10:30:18.894Z,
  lastSeenAsInt: 1650191418883,
  comments: null
}
found as nextStatement:
{
  statementID: 2354,
  content: 'this is example statement #2, it contains things.<p/>like line breaks',
  plainText: null,
  coded: false,
  updatedAt: 2022-04-17T12:21:21.525Z,
  lastSeenAsInt: 1650198081516,
  comments: null
}
cyrusae commented 2 years ago

Reported it to the mothership