Skip to content

Commit 9f31b83

Browse files
committed
fix: make list decode sequential for deterministic error correlation
Remove { concurrency: "unbounded" } from ProviderSessionRuntimeRepository.list's Effect.forEach so that when multiple rows fail to decode, the first failing row in the query's sort order (last_seen_at ASC, thread_id ASC) deterministically surfaces its threadId in the PersistenceDecodeError, consistent with AuthSessions.listActive.
1 parent 1f0f376 commit 9f31b83

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

apps/server/src/persistence/ProviderSessionRuntime.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -280,19 +280,16 @@ export const make = Effect.gen(function* () {
280280
),
281281
),
282282
Effect.flatMap((rows) =>
283-
Effect.forEach(
284-
rows,
285-
(row) =>
286-
decodeRuntimeRow(row).pipe(
287-
Effect.mapError((cause) =>
288-
PersistenceDecodeError.fromSchemaError(
289-
"ProviderSessionRuntimeRepository.list:decodeRows",
290-
cause,
291-
{ threadId: row.threadId },
292-
),
283+
Effect.forEach(rows, (row) =>
284+
decodeRuntimeRow(row).pipe(
285+
Effect.mapError((cause) =>
286+
PersistenceDecodeError.fromSchemaError(
287+
"ProviderSessionRuntimeRepository.list:decodeRows",
288+
cause,
289+
{ threadId: row.threadId },
293290
),
294291
),
295-
{ concurrency: "unbounded" },
292+
),
296293
),
297294
),
298295
);

0 commit comments

Comments
 (0)