fix: race condition after resumable stream ends (#986)

This commit is contained in:
Jeremy 2025-05-07 16:02:53 -07:00 committed by GitHub
parent 566b01f367
commit 75af1320f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 145 additions and 18 deletions

View file

@ -500,7 +500,7 @@ export async function getStreamIdsByChatId({ chatId }: { chatId: string }) {
.select({ id: stream.id })
.from(stream)
.where(eq(stream.chatId, chatId))
.orderBy(desc(stream.createdAt))
.orderBy(asc(stream.createdAt))
.execute();
return streamIds.map(({ id }) => id);