ENG-4287 variant: terminal open via tRPC mutation (vs server action)#395
Merged
Conversation
…287 variant)
Alternative to the next-safe-action server action: terminal create/connect
now runs through a `sandbox.openTerminal` tRPC mutation (protectedTeamProcedure,
alongside killTerminalPty). The vanilla tRPC client is injected into
openTerminalSandbox from the component, the return type is inferred from the
router, and timeouts are signaled via a TRPCError('TIMEOUT') the client maps
back to a TimeoutError so attach-retry still works.
This branch exists to compare the two transports; only the terminal-open path
differs from the server-action branch (the filesystem inspector is unchanged).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
6561817
into
move-sandbox-state-management-server-side-eng-4287
4 checks passed
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.
Comparison branch. Base is the server-action branch (PR #381), so this diff shows only the action↔tRPC delta for the terminal-open path; the filesystem inspector and everything else are identical.
Server action (PR #381):
openTerminalSandboxAction(next-safe-action) called directly from the plainopenTerminalSandboxhelper; result is{ data, serverError }.tRPC (this branch): a
sandbox.openTerminalmutation onprotectedTeamProcedure(next tokillTerminalPty); the vanilla tRPC client is injected intoopenTerminalSandboxfrom the component, the return type is inferred from the router (TRPCRouterOutputs), and timeouts are surfaced asTRPCError('TIMEOUT')mapped back to aTimeoutErrorso attach-retry still fires.Trade-offs: tRPC unifies the sandbox router (queries already live there) and gives end-to-end inferred types + automatic team resolution via
protectedTeamProcedure; the cost is threading the client through the component (the helper isn't a hook) and slightly heavier test wiring. The server action is the local precedent for sandbox mutations (killSandboxAction) and is callable directly from the plain helper. Both keep the account token server-side. Tests: 289 passing on both branches.