Skip to content
Source
Sign inSign up
pingdotgg/t3code

Increase Effect RPC ping timeout for large snapshots #2885

ClosedPearcekieser(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2885/headopened View on GitHub

What Changed

Increases the patched Effect RPC pinger delay from 5 seconds to 60 seconds.

This changes the existing patches/effect@4.0.0-beta.73.patch so the generated RPC client waits longer before declaring the connection unhealthy due to a missed Pong.

Why

Large thread snapshots can occupy the WebSocket long enough that the Effect RPC Pong is queued behind snapshot chunks. On slow remote connections, the current 5 second heartbeat window can expire before the Pong reaches the client, causing a reconnect. The reconnect then requests the same large snapshot again, which can repeat the failure loop.

A 60 second window gives large snapshot sends more time to drain before the client treats the connection as dead.

This is a small mitigation for #2761. It does not solve the deeper issue that large snapshots and control/heartbeat messages share the same WebSocket queue; longer term, snapshots likely need pagination, truncation, backpressure, or control-message prioritization.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • UI changes are not applicable

Note

Increase Effect RPC ping interval to 60 seconds for large snapshot support

  • Updates patches/effect@4.0.0-beta.78.patch to change the protocol worker ping interval from 5 seconds to 60 seconds.
  • Adds an hooks.onPing call (when provided) before each ping is sent, allowing pre-ping side effects.
  • Behavioral Change: ping frequency drops from every 5s to every 60s, which may affect connection keepalive behavior in environments with short idle timeouts.
Macroscope summarized 2825718.

Note

Medium Risk Changes connection health detection for all Effect RPC WebSocket clients; a 60s window delays detection of truly dead peers but reduces false reconnect loops during heavy snapshot traffic.

Overview Updates the vendored effect@4.0.0-beta.78 patch so the RPC socket pinger waits 60 seconds between ping attempts instead of 5 seconds, giving large WebSocket transfers (e.g. thread snapshots) more time before the client treats a missing Pong as a dead connection.

The same patch delta wires ConnectionHooks into the ping loop: onPong runs after recording a pong, onPing runs before writePing, and both default to Effect.void when unset. pnpm-lock.yaml is refreshed so every workspace consumer resolves the new effect patch hash.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2825718f3bfd49bf709b76103cba9247dc16d904. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 869b0f55-01e6-4fd4-8ceb-cad2894b8ac5

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved

      Simple timeout configuration change from 5 to 60 seconds in an Effect RPC patch to handle large snapshots. The lockfile changes are mechanical hash updates from the patch modification.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. jamesx0416(GitHub profile, opens in a new tab) approved these changes

    5. I resolved the rebase locally, but this PR’s branch is in the organization-owned pearce-codes/t3code fork. GitHub rejects maintainer pushes to that fork, and the Update Branch API also reports a conflict. Please rebase the branch onto current main (the patch now targets patches/effect@4.0.0-beta.78.patch) or grant push access to the fork branch.

    6. Pearcekieser(GitHub profile, opens in a new tab)commented

      Thank for looking at this. Sorry for the delay was out on vacation. I recently started running into this timeouts again, so I'm hopeful this will help me and others.

      I updated this to main. I don't think orgs owned branches allow pushes from upstream's maintainers, so I re opened this under a different PR if you need to edit. New PR on a maintainer-pushable branch: https://github.com/pingdotgg/t3code/pull/3817

      Also @mincua suggested the same fix here so please try to give him credit if you merge this: https://github.com/pingdotgg/t3code/pull/3500

      Seems like this could also help fix: https://github.com/pingdotgg/t3code/issues/3553 https://github.com/pingdotgg/t3code/issues/3734

    7. Closing because the author-designated maintainer-editable replacement is #3817. The replacement PR explicitly carries this work forward.

    8. juliusmarminge closed this

Sign in to join this conversation.