fix(query): resend an unknown-effect write with its original idempotency key (03-01, 08-03)
A save whose response was lost minted a new key on the next submit, and the screen let the user declare "not applied" without evidence. The same canonical input now reuses the unknown admission's intent; the screen offers "send the same request again" and a list refresh link instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
926f448fce
commit
dfb1b9e0ee
@@ -96,9 +96,10 @@ export type AsyncSurfaceProps = Readonly<{
|
||||
onAction?: () => void;
|
||||
onRetry?: () => void;
|
||||
onResolveConflict?: () => void;
|
||||
onReconcileUnknownEffect?: (
|
||||
resolution: "APPLIED" | "NOT_APPLIED",
|
||||
) => void;
|
||||
/** Only `APPLIED` is offered: "not applied" needs evidence the UI lacks. */
|
||||
onReconcileUnknownEffect?: (resolution: "APPLIED") => void;
|
||||
/** D-1. Resends the unknown request with its original intent and key. */
|
||||
onResendUnknownEffect?: () => void;
|
||||
}>;
|
||||
|
||||
export function AsyncSurface({
|
||||
@@ -109,6 +110,7 @@ export function AsyncSurface({
|
||||
onRetry,
|
||||
onResolveConflict,
|
||||
onReconcileUnknownEffect,
|
||||
onResendUnknownEffect,
|
||||
}: AsyncSurfaceProps) {
|
||||
const { message } = useLocale();
|
||||
if (state.base === "idle") return idle ?? null;
|
||||
@@ -155,18 +157,15 @@ export function AsyncSurface({
|
||||
) : null}
|
||||
{state.indicator === "mutation-effect-unknown" &&
|
||||
onReconcileUnknownEffect ? (
|
||||
<>
|
||||
<Button
|
||||
onClick={() => onReconcileUnknownEffect("APPLIED")}
|
||||
>
|
||||
{message("action.confirmMutationApplied")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => onReconcileUnknownEffect("NOT_APPLIED")}
|
||||
>
|
||||
{message("action.confirmMutationNotApplied")}
|
||||
</Button>
|
||||
</>
|
||||
<Button onClick={() => onReconcileUnknownEffect("APPLIED")}>
|
||||
{message("action.confirmMutationApplied")}
|
||||
</Button>
|
||||
) : null}
|
||||
{state.indicator === "mutation-effect-unknown" &&
|
||||
onResendUnknownEffect ? (
|
||||
<Button onClick={onResendUnknownEffect}>
|
||||
{message("action.resendMutation")}
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user