fix(server): return correct context from middleware next#245
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis update enhances the middleware verification tests and refines the context merging in the procedure client's execution. New assertions in the tests confirm the output and context from multiple middleware functions. In the main procedure client, the context is now extracted as a new variable and merged via a helper function, streamlining the middleware execution logic. The related import statement has also been updated. Changes
Sequence Diagram(s)sequenceDiagram
participant C as Caller
participant PC as ProcedureClient
participant MC as mergeCurrentContext
participant M as Middleware
participant H as Handler
C->>PC: executeProcedureInternal(options)
PC->>PC: Extract midContext from options
PC->>MC: mergeCurrentContext(currentContext, midContext)
MC-->>PC: merged context
PC->>M: Execute pre-middleware functions
M-->>PC: Return pre-middleware result
PC->>H: Execute procedure handler with merged context
H-->>PC: Handler result
PC->>M: Execute post-middleware functions
M-->>PC: Return post-middleware result
PC-->>C: Return final result
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
ERR_PNPM_OPTIONAL_DEPS_REQUIRE_PROD_DEPS Optional dependencies cannot be installed without production dependencies 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
More templates
@orpc/client
@orpc/contract
@orpc/openapi
@orpc/openapi-client
@orpc/react-query
@orpc/server
@orpc/shared
@orpc/solid-query
@orpc/standard-server
@orpc/standard-server-fetch
@orpc/svelte-query
@orpc/vue-colada
@orpc/vue-query
@orpc/standard-server-node
@orpc/zod
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
Recent changes not restrict middleware out context match with in context, so we need reflect it in runtime.
Summary by CodeRabbit
Summary by CodeRabbit