fix: do not pass signal into server function#5470
Conversation
📝 WalkthroughWalkthroughRemoves AbortSignal propagation from server function plumbing: updates createServerFn API and codegen to drop signal, adjusts server handler to stop wiring request abort signals, and updates related tests and an e2e route/spec. Also bumps srvx versions across e2e packages, tweaks a plugin script, and adds a Wrangler config scaffold. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant C as Client App
participant SF as ServerFn (client wrapper)
participant H as Server Handler
participant A as Action (handler)
U->>C: Trigger server function
C->>SF: call fn(opts)
SF->>H: HTTP request (opts)
Note over SF,H: No AbortSignal is created or forwarded
H->>A: action(opts)
A-->>H: result | error
H-->>SF: HTTP response
SF-->>C: resolve/reject
C-->>U: render outcome
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 66148c7
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/start-client-core/src/createServerFn.ts (1)
132-155: Fix the__executeServercontract after droppingsignal.The runtime now calls
__executeServer(opts)with no signal, butFetcherBase['__executeServer']still requires{ signal: AbortSignal }. Any TS consumer (including the plugin-generated stubs) will fail type-checking becauseoptsno longer has that property. Please drop thesignalfield (or make it optional) in theFetcherBasesignature to keep the public types aligned with the new behavior.export interface FetcherBase { [TSS_SERVER_FUNCTION]: true url: string - __executeServer: (opts: { - method: Method - data: unknown - headers?: HeadersInit - context?: any - signal: AbortSignal - }) => Promise<unknown> + __executeServer: (opts: { + method: Method + data: unknown + headers?: HeadersInit + context?: any + }) => Promise<unknown> }Also applies to: 258-264
🧹 Nitpick comments (1)
e2e/react-start/server-functions/src/routes/abort-signal.tsx (1)
42-106: LGTM!The Test component correctly implements method-specific testing with proper state management, abort scenarios, and error handling. The method-specific test IDs (
run-with-abort-btn-${method},result-${method}, etc.) align well with e2e test expectations.The union type for the
fnprop (line 47) works correctly since both handlers wrap the same underlying function. If desired, you could define a common type alias for cleaner typing, but this is optional.Optional: Consider extracting a common type for the server function.
For improved type clarity, you could define a common type:
+type AbortableServerFn = typeof abortableServerFnPost + function Test({ method, fn, }: { method: string - fn: typeof abortableServerFnPost | typeof abortableServerFnGet + fn: AbortableServerFn }) {However, this is a minor improvement and the current approach is acceptable.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (40)
e2e/react-start/basic-react-query/package.json(1 hunks)e2e/react-start/basic-tsr-config/package.json(1 hunks)e2e/react-start/basic/package.json(1 hunks)e2e/react-start/custom-basepath/package.json(1 hunks)e2e/react-start/scroll-restoration/package.json(1 hunks)e2e/react-start/selective-ssr/package.json(1 hunks)e2e/react-start/serialization-adapters/package.json(1 hunks)e2e/react-start/server-functions/package.json(1 hunks)e2e/react-start/server-functions/src/routes/abort-signal.tsx(3 hunks)e2e/react-start/server-functions/tests/server-functions.spec.ts(1 hunks)e2e/react-start/server-routes/package.json(1 hunks)e2e/react-start/virtual-routes/package.json(1 hunks)e2e/react-start/website/package.json(1 hunks)e2e/solid-start/basic-tsr-config/package.json(1 hunks)e2e/solid-start/basic/package.json(1 hunks)e2e/solid-start/custom-basepath/package.json(1 hunks)e2e/solid-start/scroll-restoration/package.json(1 hunks)e2e/solid-start/selective-ssr/package.json(1 hunks)e2e/solid-start/server-functions/package.json(1 hunks)e2e/solid-start/server-routes/package.json(1 hunks)e2e/solid-start/website/package.json(1 hunks)examples/react/start-basic/wrangler.jsonc(1 hunks)packages/start-client-core/src/createServerFn.ts(1 hunks)packages/start-client-core/src/tests/createServerFn.test-d.ts(0 hunks)packages/start-plugin-core/package.json(2 hunks)packages/start-plugin-core/src/create-server-fn-plugin/handleCreateServerFn.ts(1 hunks)packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts(4 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx(1 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx(1 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx(1 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx(1 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx(1 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx(1 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx(2 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx(2 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx(3 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx(1 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx(1 hunks)packages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsx(1 hunks)packages/start-server-core/src/server-functions-handler.ts(3 hunks)
💤 Files with no reviewable changes (1)
- packages/start-client-core/src/tests/createServerFn.test-d.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/package.json
📄 CodeRabbit inference engine (AGENTS.md)
Use workspace:* protocol for internal dependencies in package.json files
Files:
e2e/react-start/serialization-adapters/package.jsone2e/solid-start/selective-ssr/package.jsone2e/solid-start/server-functions/package.jsone2e/react-start/custom-basepath/package.jsone2e/react-start/basic-tsr-config/package.jsone2e/solid-start/scroll-restoration/package.jsone2e/solid-start/website/package.jsone2e/react-start/basic-react-query/package.jsone2e/solid-start/basic/package.jsone2e/solid-start/custom-basepath/package.jsone2e/solid-start/basic-tsr-config/package.jsone2e/react-start/selective-ssr/package.jsonpackages/start-plugin-core/package.jsone2e/react-start/server-functions/package.jsone2e/react-start/basic/package.jsone2e/react-start/server-routes/package.jsone2e/react-start/virtual-routes/package.jsone2e/react-start/scroll-restoration/package.jsone2e/react-start/website/package.jsone2e/solid-start/server-routes/package.json
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Store end-to-end tests under the e2e/ directory
Files:
e2e/react-start/serialization-adapters/package.jsone2e/solid-start/selective-ssr/package.jsone2e/solid-start/server-functions/package.jsone2e/react-start/custom-basepath/package.jsone2e/react-start/basic-tsr-config/package.jsone2e/solid-start/scroll-restoration/package.jsone2e/solid-start/website/package.jsone2e/react-start/basic-react-query/package.jsone2e/solid-start/basic/package.jsone2e/solid-start/custom-basepath/package.jsone2e/solid-start/basic-tsr-config/package.jsone2e/react-start/selective-ssr/package.jsone2e/react-start/server-functions/tests/server-functions.spec.tse2e/react-start/server-functions/package.jsone2e/react-start/basic/package.jsone2e/react-start/server-routes/package.jsone2e/react-start/virtual-routes/package.jsone2e/react-start/scroll-restoration/package.jsone2e/react-start/website/package.jsone2e/solid-start/server-routes/package.jsone2e/react-start/server-functions/src/routes/abort-signal.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsxe2e/react-start/server-functions/tests/server-functions.spec.tspackages/start-plugin-core/tests/createServerFn/createServerFn.test.tspackages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsxpackages/start-plugin-core/src/create-server-fn-plugin/handleCreateServerFn.tspackages/start-client-core/src/createServerFn.tspackages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsxpackages/start-server-core/src/server-functions-handler.tspackages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsxe2e/react-start/server-functions/src/routes/abort-signal.tsx
packages/{*-start,start-*}/**
📄 CodeRabbit inference engine (AGENTS.md)
Name and place Start framework packages under packages/-start/ or packages/start-/
Files:
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsxpackages/start-plugin-core/package.jsonpackages/start-plugin-core/tests/createServerFn/createServerFn.test.tspackages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsxpackages/start-plugin-core/src/create-server-fn-plugin/handleCreateServerFn.tspackages/start-client-core/src/createServerFn.tspackages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsxpackages/start-server-core/src/server-functions-handler.tspackages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx
examples/{react,solid}/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep example applications under examples/react/ and examples/solid/
Files:
examples/react/start-basic/wrangler.jsonc
**/src/routes/**
📄 CodeRabbit inference engine (AGENTS.md)
Place file-based routes under src/routes/ directories
Files:
e2e/react-start/server-functions/src/routes/abort-signal.tsx
🧬 Code graph analysis (13)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (3)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (1)
withUseServer(2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (3)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (4)
withUseServer(2-8)withoutUseServer(23-29)withVariable(30-36)withZodValidator(37-43)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (4)
withUseServer(2-8)withoutUseServer(9-15)withVariable(16-22)withZodValidator(23-29)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1)
withUseServer(2-8)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (7)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (1)
withUseServer(3-13)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (1)
withUseServer(3-13)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (1)
withUseServer(3-15)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (8)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (7)
withUseServer(2-8)withArrowFunction(9-15)withArrowFunctionAndFunction(16-22)withoutUseServer(23-29)withVariable(30-36)withZodValidator(37-43)withValidatorFn(44-50)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (4)
withUseServer(2-8)withoutUseServer(9-15)withVariable(16-22)withZodValidator(23-29)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (4)
withUseServer(2-8)withoutUseServer(9-15)withVariable(16-22)withZodValidator(23-29)packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (4)
withUseServer(3-13)withoutUseServer(14-24)withVariable(25-31)withZodValidator(42-52)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (4)
withUseServer(3-15)withoutUseServer(16-26)withVariable(27-33)withZodValidator(44-54)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (1)
withUseServer(3-11)packages/start-client-core/src/createServerFn.ts (1)
createServerFn(49-169)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (3)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (2)
withUseServer(3-13)withVariable(39-45)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (2)
withUseServer(3-13)withVariable(25-31)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (1)
withUseServer(3-11)
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (2)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (1)
withUseServer(3-13)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (2)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
withUseServer(2-8)packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (1)
withUseServer(3-15)
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
packages/start-client-core/src/createServerFn.ts (1)
createServerFn(49-169)
packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx (1)
packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx (3)
myAuthedFn(26-30)createAuthServerFn(24-24)deleteUserFn(31-35)
packages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsx (1)
packages/start-client-core/src/createServerFn.ts (1)
createServerFn(49-169)
packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx (1)
packages/start-client-core/src/createServerFn.ts (1)
createServerFn(49-169)
packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx (1)
packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx (3)
myAuthedFn(26-32)createAuthServerFn(24-24)deleteUserFn(33-39)
e2e/react-start/server-functions/src/routes/abort-signal.tsx (2)
packages/start-server-core/src/request-response.ts (1)
getRequest(72-75)packages/start-client-core/src/createServerFn.ts (1)
createServerFn(49-169)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test
🔇 Additional comments (27)
e2e/solid-start/basic-tsr-config/package.json (1)
23-23: Confirmsrvxrelease availability.The PR description mentions waiting for h3js/srvx#122 to release before bumping the dependency. Please hold merging until
srvx@^0.8.16is actually published; otherwise installs for this package will fail.e2e/solid-start/selective-ssr/package.json (1)
22-22: Confirm srvx 0.8.16 availability before mergePlease make sure
srvx@^0.8.16has been published before landing this; otherwise installs will fail. This PR depends on that upstream release, so let’s double-check the package is live.e2e/solid-start/scroll-restoration/package.json (1)
31-31: srvx@0.8.16 is published — no further action requirede2e/react-start/serialization-adapters/package.json (1)
30-31: Verified srvx@0.8.16 is published.e2e/solid-start/custom-basepath/package.json (1)
28-28: srvx@0.8.16 is published on npm
Merging is safe.examples/react/start-basic/wrangler.jsonc (1)
5-44: Config scaffold looks solid.Nice, comprehensive Wrangler scaffold with sensible defaults and helpful pointers. 👍
e2e/solid-start/server-routes/package.json (1)
32-32: srvx@0.8.16 is published
npm registry confirms version 0.8.16 is available on npm.e2e/react-start/server-functions/tests/server-functions.spec.ts (1)
273-319: LGTM! Well-structured parameterization.The refactoring to parameterize the abort tests over HTTP methods ('get', 'post') reduces duplication and improves maintainability. The test logic correctly:
- Uses method-specific test IDs that align with the updated UI components
- Properly waits for network idle and selector visibility before assertions
- Validates both success and abort scenarios with appropriate expectations
The leading semicolon on line 273 is a valid defensive pattern to prevent ASI issues.
e2e/react-start/server-functions/src/routes/abort-signal.tsx (3)
2-3: LGTM!The new imports are correctly added to support the refactored signal handling pattern.
7-15: LGTM!The route component cleanly separates POST and GET test scenarios, enabling independent verification of abort signal handling for each HTTP method.
39-41: LGTM!The per-method handlers correctly wrap the shared abort logic, enabling independent testing of POST and GET requests. This pattern aligns with the PR's goal of refactoring signal handling.
packages/start-plugin-core/package.json (1)
29-29: LGTM! Script glob pattern corrected.The glob pattern now correctly targets
**/*snapshots*(plural), which better matches the actual snapshot directory/file naming convention.packages/start-plugin-core/tests/createServerFn/snapshots/client/factory.tsx (1)
26-35: LGTM! Handler signatures correctly updated to remove signal parameter.The compiled client-side handlers now accept a single
optsparameter and pass onlyoptsto__executeServer, consistent with the PR objective to remove AbortSignal propagation from server function plumbing.packages/start-plugin-core/tests/createServerFn/createServerFn.test.ts (2)
76-96: LGTM! Test expectations correctly updated.The inline snapshot expectations now reflect the new single-argument handler signature
(opts)and single-argument__executeServer(opts)calls, consistent with the signal removal across the codebase.
117-157: LGTM! Test expectations consistently updated across all scenarios.All test cases (exported/non-exported functions, client/server environments) now correctly expect the single-argument handler pattern, ensuring comprehensive test coverage for the new API shape.
packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructuredRename.tsx (1)
1-29: LGTM! Renamed import variant correctly updated.All handlers in this destructured-rename test snapshot now use the single-argument
(opts)signature and pass onlyoptsto__executeServer, consistent with the signal removal refactor.packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnValidator.tsx (1)
3-11: LGTM! Server-side validator snapshot correctly updated.The server-side compiled output correctly shows the handler accepting a single
optsparameter and forwarding it to__executeServer(opts), even when using input validation. The actual implementation function signature remains unchanged.packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnStarImport.tsx (1)
1-29: LGTM! Star import variant correctly updated.All handlers using the
TanStackStart.createServerFn(star import) pattern now correctly use the single-argument signature and forward onlyoptsto__executeServer.packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnDestructured.tsx (1)
1-50: LGTM! Comprehensive client-side snapshot correctly updated.All handler variants (with/without use server directive, arrow functions, validators, etc.) consistently use the single-argument
(opts)signature and call__executeServer(opts)without the signal parameter. This ensures comprehensive test coverage for the new API shape.packages/start-plugin-core/tests/createServerFn/snapshots/client/isomorphic-fns.tsx (1)
5-14: LGTM! Isomorphic functions correctly updated.The isomorphic server function wrappers (
getServerEnvandgetServerEcho) now correctly use the single-argument handler signature, ensuring consistency between regular server functions and isomorphic functions.packages/start-plugin-core/tests/createServerFn/snapshots/client/createServerFnValidator.tsx (1)
4-7: LGTM! Handler signature updated consistently.The handler signature and
__executeServercall have been correctly updated to remove thesignalparameter, aligning with the PR objective to remove signal propagation from server functions.packages/start-plugin-core/tests/createServerFn/snapshots/server/factory.tsx (2)
26-29: LGTM! Factory function signatures updated correctly.Both
myAuthedFnanddeleteUserFnhave been updated to use the single-parameter handler signature, with corresponding updates to__executeServercalls.
33-36: Consistent update for deleteUserFn.The changes mirror those in
myAuthedFn, maintaining consistency across the factory pattern.packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructured.tsx (1)
5-8: LGTM! All server function handlers updated consistently.All seven server function definitions in this snapshot have been correctly updated to remove the
signalparameter from both handler signatures and__executeServerinvocations. The changes are consistent across functions with different patterns (arrow functions, validators, etc.).Also applies to: 16-19, 23-26, 30-33, 41-44, 58-61, 69-72
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnStarImport.tsx (1)
5-8: LGTM! Star import variant updated correctly.The snapshot correctly reflects the signal removal for the
TanStackStart.createServerFnusage pattern. All handlers and__executeServercalls have been updated consistently.Also applies to: 18-21, 29-32, 46-49
packages/start-plugin-core/tests/createServerFn/snapshots/server/createServerFnDestructuredRename.tsx (1)
5-8: LGTM! Destructured rename variant updated correctly.The snapshot shows correct signal removal for the renamed
serverFnimport pattern. Changes are consistent with other variants.Also applies to: 16-19, 27-30, 44-47
packages/start-plugin-core/tests/createServerFn/snapshots/server/isomorphic-fns.tsx (1)
5-8: Confirm srvx bump & tests Allpackage.jsonentries now referencesrvx@^0.8.16; nosignal-related TODOs or usage found in tests. Ensure all tests pass with the updated snapshots and verify that request cancellation still works as expected.
| const fn = createServerOnlyFn(async () => { | ||
| const request = getRequest() | ||
| const signal = request.signal | ||
| console.log('server function started', { signal }) | ||
| return new Promise<string>((resolve, reject) => { | ||
| if (signal.aborted) { | ||
| return reject(new Error('Aborted before start')) | ||
| } | ||
| const timerId = setTimeout(() => { | ||
| console.log('server function finished') | ||
| resolve('server function result') | ||
| }, 1000) | ||
| const onAbort = () => { | ||
| clearTimeout(timerId) | ||
| console.log('server function aborted') | ||
| reject(new Error('Aborted')) | ||
| } | ||
| signal.addEventListener('abort', onAbort, { once: true }) | ||
| }) | ||
| }) |
There was a problem hiding this comment.
🧩 Analysis chain
Verify request.signal availability after srvx dependency bump.
The abort handling logic is correct: early exit check, proper timeout cleanup, and { once: true } listener registration to prevent memory leaks. However, the code assumes request.signal is available via getRequest().
Since the PR description mentions this change depends on h3js/srvx#122, ensure the srvx dependency is bumped and that request.signal is properly exposed in the updated version.
Run the following script to verify the srvx version and check for related changes:
🏁 Script executed:
#!/bin/bash
# Verify srvx dependency version across the monorepo
echo "=== Checking srvx versions in package.json files ==="
fd -e json -x sh -c 'if grep -q "srvx" "$1"; then echo "$1:"; grep "srvx" "$1"; fi' sh {}
echo ""
echo "=== Searching for request.signal usage in codebase ==="
rg -n --type ts -C2 'request\.signal' -g '!node_modules'Length of output: 3834
Bump srvx to a version that exposes request.signal
All package.json files remain at ^0.8.16, which doesn’t include the getRequest().signal change from h3js/srvx#122—update srvx to the released version that adds request.signal before merging.
🤖 Prompt for AI Agents
In e2e/react-start/server-functions/src/routes/abort-signal.tsx around lines 18
to 37, the code uses getRequest().signal but the repo's package.json still pins
srvx to ^0.8.16 which does not include the h3js/srvx#122 change; update the srvx
dependency in all package.json files to the released version that exposes
request.signal (e.g., bump to >=0.8.17 or the specific released version that
contains the PR), run package manager install to update lockfiles, and verify
the tests/build so the server function can access request.signal without runtime
errors.
| "exsolve": "^1.0.7", | ||
| "pathe": "^2.0.3", | ||
| "srvx": "^0.8.2", | ||
| "srvx": "^0.8.16", |
There was a problem hiding this comment.
🧩 Analysis chain
Verify that the upstream srvx PR is merged and released.
The PR description states this change depends on h3js/srvx#122 being merged and released. Ensure that:
- The srvx PR RL integration with RQ, RT #122 has been merged and version 0.8.16 (or higher) has been published
- The changes in srvx align with the signal removal in this PR
- There are no breaking changes or security advisories between 0.8.2 and 0.8.16
🌐 Web query:
What changes were made in srvx between version 0.8.2 and 0.8.16? Are there any breaking changes or security advisories?
💡 Result:
Which "srvx" project do you mean? (npm package / GitHub repo, R package, or something else). I can then fetch the changelog/releases and check for breaking changes or security advisories between 0.8.2 and 0.8.16.
🏁 Script executed:
#!/bin/bash
set -e
echo "Checking if PR #122 is merged:"
gh api repos/h3js/srvx/pulls/122 --jq .merged
echo "Checking if release v0.8.16 exists on GitHub:"
gh api repos/h3js/srvx/releases/tags/v0.8.16 --jq .tag_name
echo "Checking if version 0.8.16 is published on npm:"
npm view srvx@0.8.16 versionLength of output: 145
Upstream PR #122 isn’t merged; defer bump to srvx v0.8.16
Version 0.8.16 is published, but PR #122’s changes aren’t included upstream. Wait for that PR to merge and a new release before updating this dependency.
🤖 Prompt for AI Agents
In packages/start-plugin-core/package.json at line 79, the dependency was
updated to "srvx": "^0.8.16" but upstream PR #122 isn’t merged so that release
doesn’t include the required changes; revert this dependency change back to the
prior published version (restore the original version string that was in
package.json before the bump), add a short inline comment/TODO referencing
upstream PR #122 to retry the bump after it merges, and run your package manager
to update the lockfile (package-lock.json or yarn.lock) accordingly.
|
srvx's side has bumped and released the fix in |
6a36d34 to
26d715f
Compare
5d86f6c to
28b171a
Compare
28b171a to
639fc21
Compare
* fix: do not pass signal into server function * fix test * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix: do not pass signal into server function * fix test * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
instead of the previously passed in signal, use this to get the signal inside the server function:
closes #4651