Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: use jsonb ? operator to avoid Neon rt_fetch bug (#13040)

Arvin Xu41c1b1ee853e
diff --git a/packages/database/src/models/topic.ts b/packages/database/src/models/topic.ts
index 349799242fe..1135abbad20 100644
--- a/packages/database/src/models/topic.ts
+++ b/packages/database/src/models/topic.ts
@@ -778,8 +778,8 @@ export class TopicModel {
eq(topics.userId, this.userId),
eq(topics.agentId, agentId),
eq(topics.trigger, 'cron'),
- // Check if metadata contains cronJobId
- sql`${topics.metadata}->>'cronJobId' IS NOT NULL`,
+ // Check if metadata contains cronJobId (use ? operator to avoid Neon rt_fetch bug with ->>)
+ sql`${topics.metadata} ? 'cronJobId'`,
),
)
.orderBy(desc(topics.updatedAt));