Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
Fixed lastMessageId
  • Loading branch information
fronkdev authored Jun 4, 2024
1 parent 0df7f45 commit 827fa07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export async function createTranscript<T extends ExportReturnType = ExportReturn

// add the messages to the array
allMessages.push(...filteredMessages.values());
lastMessageId = filteredMessages.lastKey();
// Get the last key of 'messages', not 'filteredMessages' because you will be refetching the same messages
lastMessageId = messages.lastKey();

// if there are no more messages, break
if (filteredMessages.size < 100) break;
Expand Down

0 comments on commit 827fa07

Please sign in to comment.