Skip to content

fix(frontend): require full config schema in onboarding backend step#4471

Merged
jog1t merged 6 commits intomainfrom
fix/onboarding-runner-config-upsert
Mar 21, 2026
Merged

fix(frontend): require full config schema in onboarding backend step#4471
jog1t merged 6 commits intomainfrom
fix/onboarding-runner-config-upsert

Conversation

@jog1t
Copy link
Contributor

@jog1t jog1t commented Mar 21, 2026

Summary

  • The onboarding backend step previously used a union schema that allowed validating with only { success: true } when the health check succeeded.
  • This caused the parsed step output to drop endpoint and other config fields, silently skipping the runner config upsert in onPartialSubmit.
  • Now the step requires the full config shape so every successful submit includes everything needed to upsert.

Changes

  • Replaced deploymentSchema.pick({ success: true }).or(z.object({ ...fullShape })) with z.object({ ...fullShape }) for the onboarding backend step schema.

Testing

  • Tested onboarding backend flow with GCP Cloud Run, Vercel, and Railway providers.
  • Confirmed client.runnerConfigsUpsert is called and runner configs appear in the namespace after the health check succeeds.

@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4471 March 21, 2026 17:09 Destroyed
@railway-app
Copy link

railway-app bot commented Mar 21, 2026

🚅 Deployed to the rivet-pr-4471 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud ✅ Success (View Logs) Web Mar 21, 2026 at 11:03 pm
frontend-inspector ✅ Success (View Logs) Web Mar 21, 2026 at 11:03 pm
ladle ❌ Build Failed (View Logs) Web Mar 21, 2026 at 11:01 pm
website 😴 Sleeping (View Logs) Web Mar 21, 2026 at 10:59 pm
mcp-hub ✅ Success (View Logs) Web Mar 21, 2026 at 10:50 pm

@claude
Copy link

claude bot commented Mar 21, 2026

PR Review

This PR fixes a real bug (the union schema silently dropping fields) and migrates actor routing from actorId to actorKey in URL params. The core fix is correct. A few issues need attention before merging:

Bugs

1. Debug console.log left in StepContent (getting-started.tsx)

console.log(formState.errors, formState.isValid, watch());

This will log to the browser console in production. Must be removed.


2. Actor input encoding breaks when data.input is undefined (engine-data-provider.tsx)

The CBOR to JSON change removed the conditional guard:

// Before
input: data.input ? btoa(String.fromCharCode(...cbor.encode(data.input))) : undefined,

// After
input: btoa(JSON.stringify(data.input)),

When data.input is undefined, JSON.stringify(undefined) returns the JS primitive undefined, and btoa(undefined) coerces it to the string "undefined" before base64-encoding. This sends "dW5kZWZpbmVk" instead of omitting the field. The guard should be restored: input: data.input !== undefined ? btoa(JSON.stringify(data.input)) : undefined.


3. Missing queryClient.prefetchQuery wrapper (getting-started.tsx)

In the onPartialSubmit handler for the provider step:

await Promise.all([
    ...(__APP_TYPE__ === "cloud" ? [...] : []),
    dataProvider.engineAdminTokenQueryOptions(), // returns options object, not a Promise
]);

dataProvider.engineAdminTokenQueryOptions() returns a query options object, not a Promise. It should be queryClient.prefetchQuery(dataProvider.engineAdminTokenQueryOptions()). Currently this entry in Promise.all resolves immediately with no prefetch effect.


Code Quality

4. Commented-out code (getting-started.tsx)

The Rivet Compute provider card block is commented out with JSX comments spanning ~20 lines. Dead code should either be deleted or tracked in a ticket rather than left in as a comment.


5. Misleading variable name (ns.$namespace/index.tsx in both cloud and engine routes)

const firstActorId = actors.pages[0]?.actors?.[0]?.key;
// ...
actorKey: firstActorId,

The variable is named firstActorId but now holds a key. Rename to firstActorKey for clarity.


6. key prop may be undefined (actors-list.tsx)

{actors.map((actor) => (
    <ActorsListRow
        key={actor.key}  // actor.key might be undefined

If actor.key can be undefined, React will warn about duplicate/missing keys. Consider: key={actor.key ?? actor.actorId}.


7. Missing newline at end of file (formatter.ts)

The file ends without a trailing newline and has two consecutive blank lines before the listFormatter declaration.


Minor Observations

  • The condition change in _engine/ns.$namespace/index.tsx from if (deps.n || deps.actorId) to if (deps.n && (deps.actorId || deps.actorKey)) changes early-return semantics. Previously, having n alone skipped the actor list fetch; now both n and an actor identifier are required. Verify this is intentional.
  • The maxRunners default changed from 100_000 to 1_000. This is a significant behavior change for new onboarding users and worth calling out in the PR description.
  • The rivet-compute.mdx rename to _rivet-compute.mdx effectively unpublishes that doc page. Ensure inbound links or sidebar entries referencing /connect/rivet-compute are updated or redirected.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 21, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4471

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4471

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4471

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4471

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4471

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4471

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4471

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4471

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4471

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4471

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4471

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4471

commit: 216a596

@jog1t jog1t force-pushed the fix/onboarding-runner-config-upsert branch from f762066 to d90b246 Compare March 21, 2026 17:24
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4471 March 21, 2026 17:24 Destroyed
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4471 March 21, 2026 22:21 Destroyed
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4471 March 21, 2026 22:33 Destroyed
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4471 March 21, 2026 22:49 Destroyed
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4471 March 21, 2026 23:01 Destroyed
@jog1t jog1t merged commit aa14da1 into main Mar 21, 2026
14 of 18 checks passed
@jog1t jog1t deleted the fix/onboarding-runner-config-upsert branch March 21, 2026 23:07
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.

1 participant