Repository navigation
Accept an abort signal in experimental_discoverRpc - #5163
Merged
Merged
Conversation
Discovery is a read that typically runs inside a React query or refresh loop, but unlike the other read calls in the plugins area it could not be cancelled. Pass an optional signal through to the request. Refs #4944 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
PluginsArea.experimental_discoverRpcaccepted only thepluginId/methodfilters and calledrequestParsedwithout a signal, so discovery — a read that typically runs inside a React query or refresh loop — could not be cancelled, unlike the other read calls in the plugins area (part 3 of #4944).What changed
packages/sdk/src/areas/plugins.ts: newPluginRpcDiscoveryArgs(the discovery query plussignal?: AbortSignal) and the signal is passed through to the request, same ascallRpc. The server contract query type and the wire format are unchanged; the signal is stripped by the query schema parse.docs/api_to_audit.md: discovery entry documentssignal.@get-bb/plugin-sdkto 0.6.29 (not yet published), which will carry this type change.Parts 1 (handler refusal status) and 2 (cross-plugin
useRealtime) of #4944 are not addressed here.How you verified
packages/sdk/test/plugin-rpc-discovery.test.tsaborts an in-flight discovery request; it hangs and times out without the fix and passes with it.pnpm exec turbo run test typecheck --filter=@bb/sdk(118 tests pass);typecheck linton@bb/sdk,@get-bb/plugin-sdk,@bb/domain.check-npm-version-guard.mjspasses.Refs #4944
🤖 Generated with Claude Code