Skip to content

fix(realtime): redial backoff resets on the node's first frame; wake on online/visible - #855

Merged
sebyx07 merged 3 commits into
mainfrom
fix/realtime-reconnect-stable-wake
Oct 22, 2026
Merged

sebyx07 merged 3 commits into
mainfrom
fix/realtime-reconnect-stable-wake

Conversation

@sebyx07

@sebyx07 sebyx07 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

What

  • LiveClient resets its redial attempt on the node's first frame instead of on open. A proxy or overloaded node that accepts the upgrade and drops it before speaking no longer pins the tab at ~0.5 s redials.
  • New internal LiveClient.wake(): when a local backoff is armed, dial now. page-socket.ts calls it on online and a visible visibilitychange. A node-assigned drain slot (reconnect frame) is kept, so the deploy herd stays spread.

Why

Found auditing tesote/marketing's realtime path for production readiness (laptop wake / flaky proxy cases).

Tests

  • client-wake.test.ts (new): open-then-drop keeps backing off (500→1000→2000→4000); wake dials at once and restarts the curve; wake keeps a drain slot; no-op connected/closed.
  • client-reconnect.test.ts: the reset-the-curve case now has the node answer before the drop.
  • bun test packages/realtime: 1579 pass, 0 fail. verify --only lint,typecheck,filesize,boundaries,errors,manifest green.

🤖 Generated with Claude Code

sebyx07 and others added 3 commits October 22, 2026 16:03
…on online/visible

A socket accepted then dropped before any frame reset the curve every
time, so the tab redialled every ~0.5s. The reset now waits for the
node's first frame. The page socket also cuts a local backoff short on
`online` and a visible `visibilitychange` (LiveClient.wake()); a
node-assigned drain slot is kept so deploy herds stay spread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d bytes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@developerz-ai

developerz-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ Reviewed — nothing blocking

0 actionable comment(s) · grounded on your code

⏱ 1m 34s wall clock · gpt-6.1-sol via router · 3 model call(s) · 477 output token(s)

🤖 developerz.ai — automated review, running on your model and your box.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — 8 file(s), 0 finding(s).

Completed review [bot]: moves redial backoff reset to inbound frames and adds online/visible wakeups while preserving node-assigned drain delays; no concrete defects found in the supplied diff.

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/gpt-6.1-sol on box hv-dedicated-dev-marshall — 137.3k in / 477 out over 3 calls; cost unknown: no price on record for router/gpt-6.1-sol.

@sebyx07
sebyx07 merged commit 87d3e83 into main Oct 22, 2026
16 checks passed
@sebyx07
sebyx07 deleted the fix/realtime-reconnect-stable-wake branch October 22, 2026 21:29
@sebyx07 sebyx07 mentioned this pull request Oct 22, 2026
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.

1 participant