Skip to content

fix(frontend): treat undefined input as empty#4536

Open
abcxff wants to merge 1 commit intomainfrom
03-31-fix_frontend_treat_undefined_input_as_empty
Open

fix(frontend): treat undefined input as empty#4536
abcxff wants to merge 1 commit intomainfrom
03-31-fix_frontend_treat_undefined_input_as_empty

Conversation

@abcxff
Copy link
Copy Markdown
Contributor

@abcxff abcxff commented Mar 31, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@abcxff abcxff marked this pull request as ready for review March 31, 2026 04:37
@railway-app
Copy link
Copy Markdown

railway-app bot commented Mar 31, 2026

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

Service Status Web Updated (UTC)
frontend-inspector 😴 Sleeping (View Logs) Web Mar 31, 2026 at 4:49 am
website 😴 Sleeping (View Logs) Web Mar 31, 2026 at 4:49 am
frontend-cloud 😴 Sleeping (View Logs) Web Mar 31, 2026 at 4:49 am
mcp-hub ✅ Success (View Logs) Web Mar 31, 2026 at 4:38 am
ladle ❌ Build Failed (View Logs) Web Mar 31, 2026 at 4:38 am
kitchen-sink ❌ Build Failed (View Logs) Web Mar 31, 2026 at 4:38 am

Copy link
Copy Markdown
Contributor Author

abcxff commented Mar 31, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@abcxff abcxff requested a review from jog1t March 31, 2026 04:37
@claude
Copy link
Copy Markdown

claude bot commented Mar 31, 2026

PR Review: fix(frontend): treat undefined input as empty

Summary: This is a correct and minimal fix. When data.input is undefined/falsy, the previous code would call btoa(JSON.stringify(undefined)) which produces "dW5kZWZpbmVk" (base64 of the string "undefined"), sending unexpected data to the API instead of omitting the field.

The Fix is Correct

The change correctly leaves input as undefined when not provided, so the API call omits the field entirely rather than encoding a nonsensical value.

Minor Consideration

The falsy check (data.input ?) would also skip encoding for an empty string "", 0, or false. Since input here is actor initialization data (likely an object or null), this is fine in practice. If the type allows non-object falsy values as valid inputs, data.input != null would be marginally more precise — but given the domain context (actor input payload is a JSON-serializable object), this is a non-issue.

Verdict

LGTM. The change is correct and addresses a real bug where actors without explicit input would receive a garbled base64-encoded "undefined" string instead of omitting the field.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 31, 2026

More templates

@rivetkit/virtual-websocket

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

@rivetkit/cloudflare-workers

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

@rivetkit/framework-base

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

@rivetkit/next-js

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

@rivetkit/react

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

rivetkit

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

@rivetkit/sql-loader

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

@rivetkit/sqlite-vfs

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

@rivetkit/traces

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

@rivetkit/workflow-engine

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

@rivetkit/engine-runner

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

@rivetkit/engine-runner-protocol

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

commit: 0bffbe5

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