Skip to content

fix(ws): relax effect WebSocket ping/pong cadence to reduce flapping#7

Merged
justingray0 merged 1 commit into
mainfrom
fix/effect-ws-ping-pong-tolerance
Jun 29, 2026
Merged

fix(ws): relax effect WebSocket ping/pong cadence to reduce flapping#7
justingray0 merged 1 commit into
mainfrom
fix/effect-ws-ping-pong-tolerance

Conversation

@justingray0

Copy link
Copy Markdown
Owner

Summary

effect's default RPC pinger writes a ping every 5s and tears the socket down on a single missed pong. Over lossy / packet-reordering links (e.g. WireGuard / Tailscale) that churns the UI WebSocket and causes reconnect flapping.

Changes

Patch makePinger in the vendored effect patch to:

  • ping every 15s instead of 5s (PING_INTERVAL), and
  • only fail after 3 consecutive missed pongs (MAX_MISSED_PONGS) instead of 1, tracked via a missedPongs counter that resets on pong.

The patch also threads optional onPing / onPong connection hooks through the pinger.

  • Regenerated patches/effect@4.0.0-beta.78.patch.
  • Updated the patch_hash references in pnpm-lock.yaml (c502bc…6923666…, 114 occurrences).

Refs pingdotgg#3054.

🤖 Generated with Claude Code

effect's default pinger writes a ping every 5s and tears the socket down on
a single missed pong. Over lossy/reordering links (e.g. WireGuard/Tailscale)
that churns the UI WebSocket and causes reconnect flapping.

Patch `makePinger` to:
- ping every 15s instead of 5s, and
- only fail after 3 consecutive missed pongs (`MAX_MISSED_PONGS`) instead of 1,
  tracked via a `missedPongs` counter that resets on pong.

The patch also threads optional `onPing`/`onPong` connection hooks through the
pinger. Regenerated `patches/effect@4.0.0-beta.78.patch` and updated the
`patch_hash` references in `pnpm-lock.yaml`. See pingdotgg#3054.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Jun 29, 2026
@justingray0 justingray0 merged commit 9182e14 into main Jun 29, 2026
6 of 10 checks passed
@justingray0 justingray0 deleted the fix/effect-ws-ping-pong-tolerance branch June 29, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant