Repository navigation
Add RpcServer onDisconnect option - #9688
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: da447d0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
tim-smart
reviewed
Oct 21, 2026
| Effect.andThen( | ||
| server.disconnect(clientId), | ||
| Effect.ignoreCause(Effect.suspend(() => onDisconnect(clientId)), { | ||
| log: true, |
Contributor
There was a problem hiding this comment.
This can use the new "Unhandled" log level
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 21, 2026 20:39
ae85ca8 to
795dd25
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
2 times, most recently
from
October 21, 2026 20:52
b8add79 to
bc6e7ff
Compare
tim-smart
force-pushed
the
v4/next-minor
branch
4 times, most recently
from
October 21, 2026 22:39
8e6e2e0 to
005c3dd
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
6 times, most recently
from
October 21, 2026 23:20
17383ae to
1c516c1
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 21, 2026 23:22
bc6e7ff to
09586c0
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 21, 2026 23:23
1c516c1 to
8b2286c
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 21, 2026 23:23
09586c0 to
a89fa6f
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 21, 2026 23:24
8b2286c to
b3ec80f
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 21, 2026 23:24
a89fa6f to
3cacd9c
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 21, 2026 23:25
b3ec80f to
8f33205
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 21, 2026 23:25
3cacd9c to
8608934
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 21, 2026 23:26
8f33205 to
0c47ccc
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 21, 2026 23:26
8608934 to
4892710
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 21, 2026 23:27
0c47ccc to
eaf1e00
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 21, 2026 23:28
4892710 to
6e6dfef
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 21, 2026 23:32
eaf1e00 to
e4182ca
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 21, 2026 23:32
6e6dfef to
bc8ff1e
Compare
effect-bot
force-pushed
the
fix/rpc-server-on-disconnect
branch
from
October 22, 2026 00:01
2095890 to
da447d0
Compare
Merged
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
to devangpratap/effect
that referenced
this pull request
Oct 22, 2026
tim-smart
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
tim-smart
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
tim-smart
pushed a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
effect-bot
added a commit
that referenced
this pull request
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RpcServer.maketakes fromProtocol.disconnects, a single-consumer queue, to interrupt a disconnected client's in-flight requests. An application that takes from the same queue to observe disconnects can steal a notification, which stops the server from cleaning up that client.This adds an optional
onDisconnect(clientId)callback toRpcServer.make. It is also accepted bylayer,layerHttp,toHttpEffectandtoHttpEffectWebsocket, which pass it through tomake.Protocol, the queue semantics and transport implementations are unchanged. Without the option, behaviour is the same as before.Tests
packages/effect/test/rpc/RpcServer.test.ts.vitest run test/rpc: 109 tests pass.pnpm checkandpnpm lintpass.Closes EFF-2696
Closes #8461