Skip to content

Support discarded RPC calls on protocols without replies - #10165

Closed
effect-bot wants to merge 7 commits into
mainfrom
agent/effect-bot/cdbde925fa7b
Closed

effect-bot wants to merge 7 commits into
mainfrom
agent/effect-bot/cdbde925fa7b

Conversation

@effect-bot

@effect-bot effect-bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

A custom RpcClient.Protocol that delivers requests but never replies (a message queue, a one-way socket) cannot use discard: true today: since 4.1.0 a discarded call waits for an acknowledgement Exit that never arrives, so it never completes.

This adds a supportsReplies capability to RpcClient.Protocol, alongside supportsAck and supportsTransferables. With supportsReplies: false:

  • A discard: true call completes once send succeeds, and fails with the send error if it fails. make registers no reply entry for it. makeNoSerialization tracks it in a lifecycle entry only while the send is pending, so closing the client can interrupt the call and its send. The entry is removed when the send completes, fails or is interrupted, or when the client closes, so nothing (request, caller Context, schemas) is kept after the send. Interrupting the caller interrupts the pending send and sends no Interrupt message.
  • Per-request replies (Chunk and Exit) are ignored, so they cannot complete a call. A connection-wide Defect still fails every pending call.
  • A non-discarded unary or stream call fails at once with an RpcClientError (RpcClientDefect) naming the rpc, and nothing is sent.

All built-in protocols set supportsReplies: true, so acknowledged transports keep the 4.1 acknowledgement behaviour. makeNoSerialization gains a matching optional supportsReplies option (default true). Because Protocol is @stability unstable, the field is required, like its siblings. Custom protocols must add it, and the changeset says so.

Closes #10159
Closes EFF-3149

@changeset-bot

changeset-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 80f7e22

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-cloudflare Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/ai-typesafe Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/graphql-generator Patch
@effect/openapi-generator Patch

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

@effect-janitor effect-janitor Bot added the 4.0 label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.38 KB 39.38 KB 0.00 KB (0.00%)
basic.ts 7.21 KB 7.21 KB 0.00 KB (0.00%)
batching.ts 11.03 KB 11.03 KB 0.00 KB (0.00%)
brand.ts 6.84 KB 6.84 KB 0.00 KB (0.00%)
cache.ts 11.53 KB 11.53 KB 0.00 KB (0.00%)
config.ts 22.80 KB 22.80 KB 0.00 KB (0.00%)
differ.ts 21.96 KB 21.96 KB 0.00 KB (0.00%)
http-client.ts 26.90 KB 26.90 KB 0.00 KB (0.00%)
http-router.ts 36.88 KB 36.88 KB 0.00 KB (0.00%)
logger.ts 11.99 KB 11.99 KB 0.00 KB (0.00%)
metric.ts 9.46 KB 9.46 KB 0.00 KB (0.00%)
optic.ts 7.05 KB 7.05 KB 0.00 KB (0.00%)
pubsub.ts 16.00 KB 16.00 KB 0.00 KB (0.00%)
queue.ts 12.80 KB 12.80 KB 0.00 KB (0.00%)
schedule.ts 11.78 KB 11.78 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.06 KB 14.06 KB 0.00 KB (0.00%)
schema-binary.ts 41.09 KB 41.09 KB 0.00 KB (0.00%)
schema-class.ts 21.68 KB 21.68 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 29.55 KB 29.55 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 27.94 KB 27.94 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.31 KB 15.31 KB 0.00 KB (0.00%)
schema-string.ts 12.29 KB 12.29 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.23 KB 16.23 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 38.90 KB 38.90 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 26.13 KB 26.13 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 20.86 KB 20.86 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.00 KB 21.00 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.10 KB 21.10 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.14 KB 26.14 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.19 KB 21.19 KB 0.00 KB (0.00%)
schema.ts 20.79 KB 20.79 KB 0.00 KB (0.00%)
stm.ts 14.19 KB 14.19 KB 0.00 KB (0.00%)
stream.ts 10.36 KB 10.36 KB 0.00 KB (0.00%)

@effect-bot

Copy link
Copy Markdown
Contributor Author

Closing unmerged, replaced by #10171.

A client Protocol promises that every request ends with a reply: an Exit, or a ClientProtocolError for its id. supportsReplies: false would have to switch off most of the client: results, typed errors, streams and interrupts. It would also add a required field that every custom protocol has to adopt in a patch release.

The existing contract already covers delivery-only transports. The protocol writes a void Exit for a discard request once it has accepted the request, and a ClientProtocolError for any other request. #10171 documents that on RpcClient.Protocol and on the discard option instead.

@effect-bot effect-bot closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RpcClient: a discarded call over a protocol that never replies keeps its entry forever in 4.0.x and waits forever in 4.1.0

1 participant