fix(cost): remove deprecated device.heartbeat tRPC route#4490
Conversation
The renderer caller was removed in #2904 (2026-03-28) and the MINIMUM_DESKTOP_VERSION floor (1.5.0, 2026-04-11) blocks any client that predates the caller removal from using the app. The endpoint was kept "for backwards compat with shipped clients", but the only clients still polling are stuck behind the UpdateRequiredPage gate and their heartbeat traffic has no downstream consumer — heartbeat only updates devicePresence.lastSeenAt, which is purely cosmetic (MCP list-devices ORDER BY). Removing the route turns those stale-build calls into a silent tRPC NOT_FOUND. registerDevice stays — MCP's executeOnDevice still uses the row for ownership verification. Trims ~10% of /api log volume on Vercel.
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRemoves the deprecated ChangesDevice Router Cleanup
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
Greptile SummaryRemoves the
Confidence Score: 5/5Safe to merge — removes a fully orphaned endpoint with no remaining callers. The deleted procedure had no callers in the codebase, its only side effect was updating a cosmetic last_seen_at column, and all clients old enough to still call it are blocked at the version gate before they reach the API. registerDevice and the rest of the device router are untouched. No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/trpc/src/router/device/device.ts | Removes the deprecated heartbeat mutation from the device router; registerDevice is unchanged and no callers of device.heartbeat remain in the repo. |
Sequence Diagram
sequenceDiagram
participant SC as Stale Client (< 1.5.0)
participant GW as UpdateRequiredPage Gate
participant API as tRPC /api
participant NC as New Client (≥ 1.5.0)
SC->>GW: Any request
GW-->>SC: Blocked (UpdateRequiredPage)
Note over SC,GW: Heartbeat polls never reach API
NC->>API: device.registerDevice (startup)
API-->>NC: "{ device, timestamp }"
Note over NC,API: heartbeat route no longer exists
NC->>API: (no heartbeat polling)
Reviews (1): Last reviewed commit: "fix(cost): remove deprecated device.hear..." | Re-trigger Greptile
* fix(trpc): suppress NOT_FOUND errors in onError handler Old desktop clients (pre-1.5.0) still poll device.heartbeat which was removed in #4490. Those clients are gated behind UpdateRequiredPage and their calls have no downstream consumer, but the unconditional console.error was generating ~84k ERROR log entries since the route was deleted (2026-05-13). Suppress NOT_FOUND codes entirely — any removed or mistyped procedure hit by old clients should not pollute the error dashboard. * fix(trpc): scope NOT_FOUND suppression to device.heartbeat path only --------- Co-authored-by: sazabi[bot] <1815759+sazabi[bot]@users.noreply.github.com>
Summary
Removes
device.heartbeat, accounting for ~10% of/apilog volume on Vercel.The renderer caller was removed in #2904 (2026-03-28).
MINIMUM_DESKTOP_VERSION = "1.5.0"(released 2026-04-11) blocks every client that predates the caller removal from using the app — those clients hit theUpdateRequiredPagegate. The endpoint was kept "for backwards compat with shipped clients", but the only clients still polling are stuck behind that gate, and their heartbeat traffic has no downstream consumer.heartbeatonly updatesdevice_presence.last_seen_at, which is purely cosmetic (used forORDER BYin the MCPlist-devicestool). After this change, stale-build calls return a silent tRPCNOT_FOUND— no UI affordance, no breakage.registerDevicestays untouched — MCP'sexecuteOnDevicestill uses thedevice_presencerow for ownership verification.Test plan
/apilog volume drops by ~10% within an hour of deployNOT_FOUNDerrors in app code (only stale binaries should hit it)Summary by cubic
Removed deprecated
device.heartbeattRPC route to eliminate unused polling and cut cost, keepingregisterDevicefor MCP ownership checks. Expect ~10% drop in Vercel/apilog volume; stale clients are already blocked and now get tRPC NOT_FOUND.Written for commit f216c1e. Summary will update on new commits.
Summary by CodeRabbit