Skip to content

Report rejected Requests to YasConnection failure listeners - #47

Open
jsegaran wants to merge 2 commits into
mainfrom
jsegaran/request-failure-listener
Open

jsegaran wants to merge 2 commits into
mainfrom
jsegaran/request-failure-listener

Conversation

@jsegaran

Copy link
Copy Markdown

Adds YasConnection.onRequestFailure(listener), so an embedder can observe every Request whose promise rejects in one place, without wrapping each family client call site.

The listener receives { family, kind, error } and runs synchronously, before the rejection reaches the caller. It fires for:

  • a non-OK Result (YasResultError)
  • a Result body that fails to decode
  • a Request the server does not advertise
  • a frame that could not be written
  • a session lost with the Request still in flight

Non-OK statuses returned through requestResult resolve as envelopes and are not reported.

The hook goes on the pending request's reject rather than on a .catch around the returned promise, so resolution timing does not change. Listener exceptions go through the existing reportListenerError.

Indent's web client will use this to send YAS errors caused by our own code to Sentry. Consuming it in neo needs an @yas-run/core release that includes this change.

Tests: vitest run src/__tests__/yas.test.ts passes, including the new case. The new case fails without the change. tsc --noEmit is clean.

View in Indent
Tag @indent to continue the conversation here.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 85.6% (1081/1263) 89.4% (84/94) 89.3% (1746/1955)
browser 25.5% (309/1212) 30.4% (34/112) 27.7% (605/2183)
cli 32.4% (6661/20544) 33.6% (615/1831) 33.4% (9789/29330)
client 66.9% (4968/7425) 68.1% (627/921) 65.1% (6423/9873)
composite-transport 96.3% (526/546) 98.4% (60/61) 96.2% (884/919)
compositor 54.9% (11396/20763) 65.9% (831/1261) 54.7% (15780/28844)
desktop 78.4% (4460/5691) 71.6% (393/549) 75.1% (6211/8267)
edge 63.1% (800/1268) 50.9% (82/161) 58.0% (1043/1799)
fonts 77.3% (1257/1626) 82.7% (129/156) 78.9% (2424/3071)
fssync 86.0% (1609/1872) 85.8% (182/212) 87.0% (2833/3255)
git 70.4% (4462/6334) 68.5% (337/492) 67.2% (6311/9386)
guest 67.3% (6829/10148) 67.0% (488/728) 66.6% (8935/13416)
lsp 78.7% (3573/4542) 80.8% (336/416) 76.7% (5408/7054)
proxy 63.3% (1899/3000) 56.6% (184/325) 63.5% (2929/4613)
runtime-dir 93.6% (117/125) 100.0% (14/14) 94.8% (218/230)
sd-notify 69.6% (64/92) 100.0% (6/6) 80.9% (106/131)
server 70.8% (84418/119305) 73.3% (6132/8366) 68.8% (113101/164459)
ssh 67.2% (708/1054) 75.9% (85/112) 67.2% (1105/1645)
terminal-model 49.9% (314/629) 62.3% (38/61) 50.3% (505/1004)
uplink 94.2% (582/618) 92.6% (50/54) 93.1% (1062/1141)
webrtc-forwarder 33.6% (1321/3932) 44.9% (146/325) 36.0% (2279/6336)
webserver 80.7% (1490/1846) 81.1% (193/238) 83.2% (2551/3067)
website 35.1% (355/1012) 34.4% (53/154) 35.8% (607/1694)
xtask 0.0% (0/5149) 0.0% (0/131) 0.0% (0/9157)
yas 88.9% (28010/31522) 93.9% (2146/2286) 84.0% (43994/52388)
Total 66.5% (167209/251518) 69.5% (13245/19066) 64.9% (236849/365217)

@indent
indent Bot force-pushed the jsegaran/request-failure-listener branch from 69c2c29 to 39ab7ec Compare September 30, 2026 19:05
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