Fix issues with next/previous queries
Closed this issue · 3 comments
cyrusae commented
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
cyrusae commented
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