Skip to content

fix(functions): show the body of server function calls that send files - #43

Merged
lxsmnsyc merged 1 commit into
mainfrom
fix/rich-args-upload-viewer
Nov 3, 2026
Merged

lxsmnsyc merged 1 commit into
mainfrom
fix/rich-args-upload-viewer

Conversation

@lxsmnsyc

@lxsmnsyc lxsmnsyc commented Nov 3, 2026

Copy link
Copy Markdown
Member

What and why

@solidjs/web 2.0.0-rc.20 changed enableRichArguments(): a call whose arguments hold a File or Blob now sends multipart/form-data with X-Server-Function-Format: 0. The encoded arguments go in an args part, and each file goes in its own part (file0, file1, ...). In rc.13 these calls sent a plain serialized string.

The server functions panel checked the Serialized format first and passed the multipart body to ChunkReader. ChunkReader threw Malformed server function stream., so the request had no body in the panel and the page logged an unhandled rejection. The copied report had the same problem.

Changes

  • body-format.ts: new isUploadBody (Serialized format and a multipart content type) and splitUploadBody (the args text, and the form without it).
  • Panel: an upload body shows its arguments in SerovalViewer and its files in FormDataViewer.
  • Report: an upload body is written as seroval with files: the redacted arguments, then the list of files.
  • Dev dependencies move to solid-js, @solidjs/web and @solidjs/compiler 2.0.0-rc.20, and @solidjs/vite-plugin 3.0.0-next.55. The minimumReleaseAgeExclude entries are updated to match. The peer ranges stay at ^2.0.0-rc.13, which already includes rc.20.
  • Changeset: patch.

Compatibility with rc.20

I compared the published rc.13 and rc.20 packages. These are unchanged: the X-Server-Function-Format header, the __server_function_file__ key, format codes 0 to 8, the CallEvent, CallLive and CallRequestEvent types and OBSERVE.records. ChunkReader.next() returns the same { done, value }. The multipart upload body is the only new format the panel had to handle.

Proof

  • New e2e test shows the arguments and files of an upload call. It fails with the panel change removed (the seroval tree stays empty) and passes with it.
  • New unit test reads the arguments and files of an upload covers the report, including redaction.
  • Local checks on the rebased branch: build, tsc, vitest (151 passed), Playwright (16 passed), oxfmt --check, publint and attw.

Cost

Only adds one header check before the existing format switch. Performance pass skipped: this is a fix with no measurable cost.

Risk

Low. Only Serialized bodies with a multipart content type take the new path. Every other body is read as before.

Not done

  • If a multipart body has no args part, the panel's rejection is not caught. The existing FormDataViewer behaves the same way.
  • No body view yet for format 9 (Void) or for text/event-stream responses from live(). Both gaps were already there in rc.13.

🤖 Generated with Claude Code

With enableRichArguments() in @solidjs/web 2.0.0-rc.20, a call whose
arguments hold a File or Blob sends multipart form data marked
X-Server-Function-Format: 0. The panel and the copied report read it as a
seroval stream, which failed. Both now split the args part from the files.

Also moves the dev dependencies to 2.0.0-rc.20 and
@solidjs/vite-plugin 3.0.0-next.55.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lxsmnsyc
lxsmnsyc marked this pull request as ready for review November 3, 2026 14:07
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​solidjs/​web@​2.0.0-rc.13 ⏵ 2.0.0-rc.2010010083 +197 +1100
Updatedsolid-js@​2.0.0-rc.13 ⏵ 2.0.0-rc.20100 +110095 +196 +1100
Updated@​solidjs/​compiler@​2.0.0-rc.13 ⏵ 2.0.0-rc.2099 +3100100 +196 +2100
Updated@​solidjs/​vite-plugin@​3.0.0-next.46 ⏵ 3.0.0-next.5598 +310010097 +1100

View full report

@lxsmnsyc
lxsmnsyc merged commit fd65515 into main Nov 3, 2026
3 checks passed
@lxsmnsyc
lxsmnsyc deleted the fix/rich-args-upload-viewer branch November 3, 2026 14:19
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