Skip to content

fix(web): keep file and blob metadata in server function uploads - #4617

Merged
ryansolid merged 1 commit into
solidjs:nextfrom
lxsmnsyc:fix/upload-blob-metadata
Nov 2, 2026
Merged

ryansolid merged 1 commit into
solidjs:nextfrom
lxsmnsyc:fix/upload-blob-metadata

Conversation

@lxsmnsyc

@lxsmnsyc lxsmnsyc commented Nov 2, 2026

Copy link
Copy Markdown
Member

Port of solidjs/solid-start#2370. The upload code from #4208 has the same bug.

A multipart part always arrives on the server as a File. With enableRichArguments(), a blob comes back as a File named blob, an empty type becomes application/octet-stream, lastModified is the time the server parsed the request, and %22 in a name is decoded to ".

The upload node now carries the type, plus the name and lastModified for a file. The server rebuilds a Blob or File from those fields over the part's bytes, without copying them. A node with only the index, sent by a tab opened before a deploy, still reads as the raw part.

  • packages/web/server-functions/src/uploads.ts: write and read the metadata fields
  • packages/web/test/server/server-functions-uploads.spec.tsx: the blob test now expects a Blob with its type (including an empty one) instead of a File named blob. New tests cover the exact name and lastModified, and an index-only node from an older client.
  • Patch changeset for @solidjs/web

A single File or Blob argument still goes as a native body, not through the upload codec, so this change does not touch it.

Checked locally: the three @solidjs/web vitest suites (1647, 1934 and 754 tests), test-types, and prettier. The 3 new tests fail without the fix.

🤖 Generated with Claude Code

A multipart part always arrives as a file, with `application/octet-stream`
for an empty type, a `lastModified` of the time the server parsed it, and
`%22` in the name decoded to `"`. The upload node now carries the type,
and for a file the name and `lastModified`, and the server rebuilds the
value from them over the part's bytes. A node with only the index, from an
older client, still reads as the part.

Ports solidjs/solid-start#2370.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e4afb97

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
test-integration Patch
board-example Patch
canvas-example Patch
server-dbmon-example Patch
todos-server-example Patch
@solidjs/compiler Patch
@solidjs/signals Patch
solid-js Patch
@solidjs/universal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codspeed

codspeed Bot commented Nov 2, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 16.33%

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 2 improved benchmarks
✅ 198 untouched benchmarks
⏩ 5 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ projection derive: write one NESTED field (reference) 2.7 ms 2.1 ms +27.31%
⚡ arrow in template 11.7 ms 11 ms +6.31%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing lxsmnsyc:fix/upload-blob-metadata (e4afb97) with next (97e1826)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@ryansolid
ryansolid merged commit b7e4f16 into solidjs:next Nov 2, 2026
8 of 9 checks passed
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.

2 participants