We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36168b3 commit 93e8795Copy full SHA for 93e8795
packages/core/src/v3/serverOnly/idempotencyKeys.ts
@@ -8,14 +8,14 @@ import { IdempotencyKeyOptionsSchema } from "../schemas/api.js";
8
* @returns The user-provided key, the hash as fallback, or null if neither exists
9
*/
10
export function getUserProvidedIdempotencyKey(run: {
11
- idempotencyKey: string | null;
+ idempotencyKey: string | null | undefined;
12
idempotencyKeyOptions: unknown;
13
-}): string | null {
+}): string | undefined {
14
const parsed = IdempotencyKeyOptionsSchema.safeParse(run.idempotencyKeyOptions);
15
if (parsed.success) {
16
return parsed.data.key;
17
}
18
- return run.idempotencyKey;
+ return run.idempotencyKey ?? undefined;
19
20
21
/**
0 commit comments