feat(server,web,mobile): a host that drops because it froze now says why #22213
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits into
main fromrefs/pull/22213/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
t3dotgg(GitHub profile, opens in a new tab) closed this
- @@ -21,3 +26,17 @@2126 const STALL_THRESHOLD_MS = 2000;2227 const SAMPLE_INTERVAL = "30 seconds";2328 const STALL_LOG_MAX_BYTES = 256 * 1024;29+// Long enough that users felt it. Shorter stalls stay in the log only.30+const NOTICEABLE_STALL_MS = 5000;31+// Clients show what they get, so an old stall must not explain a new drop.32+const NOTICEABLE_STALL_MAX_AGE_MS = 5 * 60_000;33+34+export class EventLoopMonitor extends Context.Reference<{35+ /**36+ * The latest stall of 5 s or more, if seen in the last 5 minutes. It samples37+ * first, so a stall that ended just before a client reconnected is included.38+ */39+ readonly latestNoticeableStall: Effect.Effect<ServerEventLoopStall | undefined>;40+}>("t3/observability/EventLoopMonitor", {41+ defaultValue: () => ({ latestNoticeableStall: Effect.succeed(undefined) }),42+}) {}
Sign in to join this conversation.
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This PR adds a new cross-platform host-freeze notification capability, including server-side stall retention, config propagation, web toasts, and mobile connection messaging. The additive schema and tests reduce risk, but the production runtime coordination and new user-facing behavior merit human review.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).