fix: race condition after resumable stream ends (#986)
This commit is contained in:
parent
566b01f367
commit
75af1320f4
7 changed files with 145 additions and 18 deletions
|
|
@ -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);
|
||||
|
|
|
|||
1
lib/types.ts
Normal file
1
lib/types.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export type DataPart = { type: 'append-message'; message: string };
|
||||
Loading…
Add table
Add a link
Reference in a new issue