Skip to content

Commit

Permalink
fix(cu): select cached messages with correct seq where clause
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrain99 committed Jan 7, 2025
1 parent 859af1e commit fdaf89e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions servers/cu/src/effects/ao-evaluation.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,23 @@ export function findMessageBeforeWith ({ db }) {
FROM ${MESSAGES_TABLE}
WHERE
id = ?
AND "processId" = ?
AND seq < ?
AND processId = ?
AND (
CAST(substr(seq, instr(seq, ':') + 1) as UNSIGNED) < ?
OR
(
CAST(SUBSTR(seq, 1, INSTR(seq, ':') - 1) AS INTEGER) = ?
AND CAST(SUBSTR(seq, INSTR(seq, ':') + 1) AS INTEGER) < ?
)
)
LIMIT 1;
`,
parameters: [
createMessageId({ messageId, deepHash, isAssignment }),
processId,
`${epoch}:${nonce}` // 0:13
epoch,
epoch,
nonce
]
}
}
Expand Down

0 comments on commit fdaf89e

Please sign in to comment.