From c07c252eec98c47fa7ffc7480a9e489de735e60a Mon Sep 17 00:00:00 2001 From: Kotataro taniguchi <119092698+kotarotaniguchi0523@users.noreply.github.com> Date: Fri, 6 Nov 2026 17:41:24 +0000 Subject: [PATCH] fix(react): derive form state from submission outcomes and guard concurrent submits - Represent useForm submission results with a discriminated union (SubmissionOutcome) owned by useActionState, deriving errors, error, hasChanges, wasSuccessful, and recentlySuccessful without redundant state or refs. - Snapshot form data and dispatchData at dispatch time so synchronous setData() calls, in-flight edits (including under resetOnSuccess), and queued React actions preserve their submitted payload and post-success baseline. - Scope callbackOutcomeRef across async onError and synchronous onSuccess so reset(), setError(), clearErrors(), and clearError() inside callbacks operate on the incoming outcome without leaking uncommitted defaults to external UI interactions during await. - Return a fresh idle outcome when a submission aborts so previous validation errors or success states do not revive. - Represent useIslandForm state with a single IslandOutcome union and requestId so the latest started submission owns pending and UI state across completion orders. - Check 429 retryAt deadlines directly in