fix: preserve logical mutation intent
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
type InstalledHttpContract,
|
||||
} from "../../contracts/external-contract-runtime.ts";
|
||||
import type { CacheScopeSnapshot } from "../../contracts/server-state-scope.ts";
|
||||
import type { MutationIntent } from "../../contracts/mutation-intent.ts";
|
||||
import {
|
||||
decodeJsonBytes,
|
||||
isEffectivelyEmpty,
|
||||
@@ -19,7 +20,6 @@ import {
|
||||
import {
|
||||
certaintyForAbandonedAttempt,
|
||||
classifyProblemEffect,
|
||||
type MutationIntentContext,
|
||||
type PhysicalAttemptState,
|
||||
} from "./http-effect-certainty.ts";
|
||||
import { parseRetryAfter } from "./retry-policy.ts";
|
||||
@@ -130,7 +130,7 @@ export type CancellationOwner =
|
||||
export interface HttpExecutionContext {
|
||||
readonly signal?: AbortSignal;
|
||||
readonly scope: CacheScopeSnapshot;
|
||||
readonly intent?: MutationIntentContext;
|
||||
readonly intent?: MutationIntent;
|
||||
}
|
||||
|
||||
export interface ContractHttpExecutor {
|
||||
@@ -370,7 +370,7 @@ export function createContractHttpExecutor(
|
||||
if (contract.requestBody === "JSON") {
|
||||
headers["Content-Type"] = "application/json";
|
||||
}
|
||||
if (context.intent?.idempotencyKey) {
|
||||
if (isCommand && context.intent?.idempotencyKey) {
|
||||
headers["Idempotency-Key"] = context.intent.idempotencyKey;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user