fix(web): avoid history pagination stack overflow
This commit is contained in:
@@ -302,7 +302,12 @@ function paginate(
|
||||
if (!MESSAGE_TYPES.has(event.type) || !isAppendSurfaceEvent(event)) continue
|
||||
count++
|
||||
const sources = (event as { sourceEventSeqs?: number[] }).sourceEventSeqs
|
||||
const groupStart = sources !== undefined && sources.length > 0 ? Math.min(event.seq, ...sources) : event.seq
|
||||
let groupStart = event.seq
|
||||
if (sources !== undefined) {
|
||||
for (const source of sources) {
|
||||
if (source < groupStart) groupStart = source
|
||||
}
|
||||
}
|
||||
if (count >= maxMessages) {
|
||||
cut = groupStart
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user