Skip to content

Commit 92a7ba1

Browse files
committed
fix(logs): type the page budget over both branches' rows
1 parent 26ccccc commit 92a7ba1

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/sim/lib/logs/public-queries.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ describe('public log page carrying execution data', () => {
449449
includeJobRuns: true,
450450
sortBy: 'startedAt',
451451
sortOrder: 'desc',
452+
cursorKeys: undefined,
452453
limit: 100,
453454
})
454455

‎apps/sim/lib/logs/public-queries.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,14 @@ const MATERIALIZED_LOG_PAGE_BYTES = MAX_DURABLE_LARGE_VALUE_BYTES
381381
* `nextCursor` and sees every row once.
382382
*/
383383
function executionDataPageLimit(
384-
rows: readonly { executionData?: unknown }[],
384+
rows: readonly (PublicWorkflowLogListRow | PublicLogListRow)[],
385385
input: ReadPublicLogPageInput
386386
): number {
387387
if (!input.includeExecutionData) return input.limit
388388
let bytes = 0
389389
let admitted = 0
390390
for (const row of rows.slice(0, input.limit)) {
391-
bytes += executionDataArchiveBytes(row.executionData)
391+
if ('executionData' in row) bytes += executionDataArchiveBytes(row.executionData)
392392
if (admitted > 0 && bytes > MATERIALIZED_LOG_PAGE_BYTES) break
393393
admitted += 1
394394
}

0 commit comments

Comments
 (0)