v1.2.0:2 — retry login/signup server action once on transport failure

iOS Safari reuses a keep-alive socket the server closed while the login
form sat idle during typing, so the first Sign In / Create account POST
dies instantly with NSURLErrorNetworkConnectionLost ("The network
connection was lost"). That rejects the server-action call, hitting the
client-side catch in LoginForm/SignupForm and showing "An unexpected
error occurred"; the second tap lands on a fresh connection and works.

Add lib/retryAction.ts: retryOnTransportError() retries the action once
only when the call throws. A returned { error } (bad password, rate
limit) is a real result and passes straight through. A lost-on-a-stale-
socket POST never reached the server, so retrying it once is safe.
This commit is contained in:
Keysat
2026-06-15 16:44:33 -05:00
parent 56963ab4fd
commit 0178f8f5cc
6 changed files with 108 additions and 3 deletions
+7 -1
View File
@@ -16,6 +16,7 @@ import { v_1_1_0_7 } from './v1.1.0.7'
import { v_1_1_0_8 } from './v1.1.0.8'
import { v_1_1_0_9 } from './v1.1.0.9'
import { v_1_2_0_1 } from './v1.2.0.1'
import { v_1_2_0_2 } from './v1.2.0.2'
/**
* Version graph for the `proof-of-work` package.
@@ -61,9 +62,13 @@ import { v_1_2_0_1 } from './v1.2.0.1'
* v1.2.0:1 — Next.js 14 -> 15 / React 18 -> 19 upgrade. Closes the Next
* framework RSC + middleware-bypass CVEs; async-params migration
* across all [id] routes + server pages. No schema/data change.
* v1.2.0:2 — Login/signup first-tap retry: iOS Safari drops the first
* server-action POST on a stale keep-alive socket
* (NSURLErrorNetworkConnectionLost); retry once on transport
* failure. Client-only, no schema/data change.
*/
export const versionGraph = VersionGraph.of({
current: v_1_2_0_1,
current: v_1_2_0_2,
other: [
v_1_0_0_1,
v_1_0_0_2,
@@ -81,5 +86,6 @@ export const versionGraph = VersionGraph.of({
v_1_1_0_7,
v_1_1_0_8,
v_1_1_0_9,
v_1_2_0_1,
],
})