[codex] fix: tolerate invalid latest user message timestamps (#3521)
Co-authored-by: Codex <[email protected]> Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
2 files changed
+75
-1
No files matched your search
@@ -32,7 +32,10 @@ function getFirstSortableTimestamp(...values: Array<string | null | undefined>):
|
||||
|
||||
function getLatestUserMessageTimestamp(thread: ThreadSortInput): number {
|
||||
if (thread.latestUserMessageAt) {
|
||||
return toSortableTimestamp(thread.latestUserMessageAt) ?? Number.NEGATIVE_INFINITY;
|
||||
const latestUserMessageTimestamp = toSortableTimestamp(thread.latestUserMessageAt);
|
||||
if (latestUserMessageTimestamp !== null) {
|
||||
return latestUserMessageTimestamp;
|
||||
}
|
||||
}
|
||||
|
||||
let latestUserMessageTimestamp: number | null = null;
|
||||
|
||||
Reference in new issue
Block a user