Skip to content

Come back to a match without watching the reconnect overlay - #77

Merged
JaspervdM80 merged 4 commits into
mainfrom
claude/match-reconnection-delay-bw2c5h
Aug 11, 2026
Merged

Come back to a match without watching the reconnect overlay#77
JaspervdM80 merged 4 commits into
mainfrom
claude/match-reconnection-delay-bw2c5h

Conversation

@JaspervdM80

Copy link
Copy Markdown
Owner

Switching away from the app during a match and back again left "Reconnecting..."
on screen for about ten seconds, over a circuit the server was still holding.

Nothing here was waiting: Blazor fires its first ten reconnect attempts with no
delay between them at all, and a phone coming out of suspension has no network
for that first moment — so all ten are spent and failed instantly, and every
real reconnect starts from the five-second bucket that follows. The recorded
schedule reads 0,0,0,0,0,0,0,0,0,0,5,4,3,2,1,0.

Start Blazor by hand to replace that with one immediate attempt and then one a
second, which is where a phone's radio actually comes back, and stretch the
disconnected-circuit retention to ten minutes so stepping away for longer than
the stock three still rejoins the match screen instead of rebuilding it. The
retained-circuit count is capped in the same breath — reading is public, so
every passer-by leaves a circuit behind for the length of that window.

A machine Fly has scaled to zero still costs a reload; a restarted process has
no circuits to rejoin. Said so in deployment.md rather than pretending otherwise.

reconnect.spec.js reads the schedule Blazor applies rather than timing a rejoin,
and fails against the stock one.

claude added 4 commits August 11, 2026 19:44
Switching away from the app during a match and back again left "Reconnecting..."
on screen for about ten seconds, over a circuit the server was still holding.

Nothing here was waiting: Blazor fires its first ten reconnect attempts with no
delay between them at all, and a phone coming out of suspension has no network
for that first moment — so all ten are spent and failed instantly, and every
real reconnect starts from the five-second bucket that follows. The recorded
schedule reads 0,0,0,0,0,0,0,0,0,0,5,4,3,2,1,0.

Start Blazor by hand to replace that with one immediate attempt and then one a
second, which is where a phone's radio actually comes back, and stretch the
disconnected-circuit retention to ten minutes so stepping away for longer than
the stock three still rejoins the match screen instead of rebuilding it. The
retained-circuit count is capped in the same breath — reading is public, so
every passer-by leaves a circuit behind for the length of that window.

A machine Fly has scaled to zero still costs a reload; a restarted process has
no circuits to rejoin. Said so in deployment.md rather than pretending otherwise.

reconnect.spec.js reads the schedule Blazor applies rather than timing a rejoin,
and fails against the stock one.
… circuits

Four things the review found, all of them real:

The start call lived in wwwroot/js, which made the app's whole interactivity
depend on a second file arriving — and fail silently in exactly the way an empty
blazor.web.js already does here. It is inline now, so it cannot go missing on
its own.

The retry window ran out after ~69 seconds against a ten-minute retention, so a
tab that stayed awake gave up at minute one of a half-time break, and a long
dead spot reloaded onto the browser's error page with nothing left retrying.
It now covers the retention period.

Capping DisconnectedCircuitMaxRetained at 20 bought memory nobody was short of
by making eviction likelier, and the circuit evicted could as easily be the
coach's. Back to the stock 100 — only unclean disconnects park a circuit at all,
since a tab closed properly gives its own up on the spot.

The spec's schedule assertion read Math.max of a possibly empty array, which is
-Infinity and passes: had a reload wiped the recorded events, the one thing this
test exists to measure would have been measured on nothing.

Also dropped a dead maxRetries guard: the callback is documented as taking it,
Blazor calls it with one argument, and the retry loop applies the cap itself.
@JaspervdM80
JaspervdM80 merged commit 09ff94b into main Aug 11, 2026
4 checks passed
@JaspervdM80
JaspervdM80 deleted the claude/match-reconnection-delay-bw2c5h branch August 11, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants