Skip to content

Commit d188915

Browse files
author
Ryan Vogel
committed
fix(push-relay): update Session.get to use direct DB access after Effect migration
1 parent bda7a48 commit d188915

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

packages/opencode/src/server/push-relay.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,16 @@ async function notify(input: { type: Type; sessionID: string }): Promise<Notify>
326326
}
327327

328328
try {
329-
const [{ Session }, { MessageV2 }] = await Promise.all([import("@/session"), import("@/session/message-v2")])
329+
const [{ Session }, { MessageV2 }, { SessionTable }, { Database, eq }] = await Promise.all([
330+
import("@/session"),
331+
import("@/session/message-v2"),
332+
import("@/session/session.sql"),
333+
import("@/storage/db"),
334+
])
330335
const sessionID = SessionID.make(input.sessionID)
331-
const session = await Session.get(sessionID)
332-
out.title = session.title
336+
const row = Database.use((db) => db.select().from(SessionTable).where(eq(SessionTable.id, sessionID)).get())
337+
const session = row ? Session.fromRow(row) : undefined
338+
out.title = session?.title
333339

334340
let latestUser: string | undefined
335341
for await (const msg of MessageV2.stream(sessionID)) {

0 commit comments

Comments
 (0)