short cirtuit out of live comment query if possible (#2318)

This commit is contained in:
Keyan 2025-07-23 14:34:49 -05:00 committed by GitHub
parent 6cc87ceac4
commit 6a3155fa93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -749,7 +749,7 @@ export default {
FROM "Item" FROM "Item"
-- comments can be nested, so we need to get all comments that are descendants of the root -- comments can be nested, so we need to get all comments that are descendants of the root
${whereClause( ${whereClause(
'"Item".path <@ (SELECT path FROM "Item" WHERE id = $1)', '"Item".path <@ (SELECT path FROM "Item" WHERE id = $1 AND "Item"."lastCommentAt" > $2)',
activeOrMine(me), activeOrMine(me),
'"Item"."created_at" > $2' '"Item"."created_at" > $2'
)} )}