Skip to content

fix(protocols-trpc): apply controller pipes to client input arguments - #3482

Merged
kang-heewon merged 4 commits into
trunkfrom
fix/3206-trpc-pipes
Oct 11, 2026
Merged

kang-heewon merged 4 commits into
trunkfrom
fix/3206-trpc-pipes

Conversation

@kang-heewon

@kang-heewon kang-heewon commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Closes #3206.

Behavior change

Controller and method @UsePipes transform tRPC body, path, query, and header arguments in class → method order. Async pipes run inside the interceptor-wrapped request lifecycle, injected providers use the request context, and failures reach the existing Problem/filter pipeline. Context, raw, and authentication arguments retain their existing values.

Input schemas run before tRPC pipes. The README documents this ordering relative to HTTP parameter validation. The input envelope and public types are unchanged.

Validation

  • Negative control: seven regression assertions fail on the pre-fix implementation; schema rejection already passes.
  • tRPC: 133 tests passed. HTTP pipe and contract parity: 40 tests passed. The same-controller HTTP/tRPC fixture returns {name: "Ada"} once per request on both transports.
  • Frozen install and the 19-package tRPC/HTTP dependency build passed.
  • Repository companion and pnpm check passed, including architecture, Problem registry, public API, inventory, and repository contracts.
  • API documentation drift check passed: 138 tasks. The conflict resolution preserves all 981 current registry entries and changes only the four tRPC diagnostic source locations.
  • Independent code review and verification passed with no actionable findings. Existing negative-control and packed ESM/CJS consumer evidence remains applicable to the unchanged pipe implementation and publication configuration.
  • Normal pre-push verification: 311 successful test tasks and 328 successful guarded typecheck tasks; tracked files unchanged.
  • Both protocols-trpc and problems-core have patch release metadata.

Residual risk

Pipes receive schema-parsed tRPC input and cannot repair values rejected by the input schema. This parser order is documented and tested.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 71a23efa-c5a1-4f38-a2f2-f077daea4af0

📥 Commits

Reviewing files that changed from the base of the PR and between a2491fc and a9a9d80.


⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**

📒 Files selected for processing (8)
  • .changeset/trpc-controller-input-pipes.md
  • docs/problem-code-registry.json
  • packages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.md
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/protocols-trpc/README.md
  • packages/protocols-trpc/src/libs/createTrpcRouter.ts
  • packages/protocols-trpc/src/tests/TrpcPipes.spec.ts
  • test-inventory.json

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 14.2μs 30.0ms 8.2μs +73.5% ❌ -
CrocoApp lambdaHandler (10 controllers) 1.5ms 50.0ms 258.4μs +473.2% ❌ -
Lambda cold-start simulation 1.6ms 80.0ms 418.1μs +287.8% ❌ -
Lambda cold-start with headers 1.6ms 80.0ms 369.7μs +324.3% ❌ -
Lambda cold-start with binary body 1.4ms 80.0ms 339.1μs +323.3% ❌ -
Lambda cold-start with query params 1.4ms 80.0ms 301.3μs +369.3% ❌ -
Lambda cold-start with authorizer context 1.4ms 80.0ms 299.8μs +377.3% ❌ -
Lambda cold-start realistic scenario 1.4ms 80.0ms 299.2μs +368.4% ❌ -
EventBusConfig.start (10 handlers) 5.6μs 10.0ms 1.4μs +291.6% ❌ -
EventPublisher.publishNow single event 2.5μs 2.0ms 1.7μs +50.0% ❌ -
DefaultHandlerResolver.resolve × 10 0.2μs 5.0ms 0.1μs +113.8% ❌ -
Container.get singleton (cold) 116.7μs 5.0ms 70.3μs +66.2% ❌ -
Container.register × 50 components 3.2ms 10.0ms 3.2ms -1.2% ✅ -
Container.validate (50 components) 3.5ms 20.0ms 3.4ms +4.4% ✅ -
Container.get singleton (warm) 1.0μs 500.0μs 1.6μs -39.9% ✅ -
TelemetryRuntime.init (lambda preset) 13.9μs 200.0ms 1.1ms -98.7% ✅ -
lambdaPreset config creation 1.4μs 2.0ms 1.4μs +0.8% ✅ -

Updated: 2026-10-11T12:28:21.903Z · Commit: a9a9d80

@kang-heewon
kang-heewon merged commit ff35df4 into trunk Oct 11, 2026
20 of 21 checks passed
@kang-heewon
kang-heewon deleted the fix/3206-trpc-pipes branch October 11, 2026 13:46
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.

[protocols-trpc] createTrpcRouter가 @UsePipes를 실행하지 않아 같은 controller의 입력 변환 결과가 HTTP와 달라진다

2 participants