Skip to content

fix(1.x): keep file and blob metadata in server function uploads - #2371

Merged
birkskyum merged 1 commit into
1.xfrom
fix/upload-blob-metadata-1x
Nov 2, 2026
Merged

birkskyum merged 1 commit into
1.xfrom
fix/upload-blob-metadata-1x

Conversation

@lxsmnsyc

@lxsmnsyc lxsmnsyc commented Nov 2, 2026

Copy link
Copy Markdown
Member

Port of #2370 to 1.x. #2360 brought the same upload code to 1.x, so it has the same bug.

A multipart part always arrives on the server as a File. 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/start/src/runtime/uploads.ts: write and read the metadata fields
  • packages/start/src/runtime/uploads.test.ts: tests for blobs, empty types, exact names, lastModified, and index-only nodes
  • Patch changeset for @solidjs/start

Checked locally: tsc --noEmit and vitest run (133 tests). The empty-type and name/lastModified 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.

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: 93f3983

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

This PR includes changesets to release 1 package
Name Type
@solidjs/start 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

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/start@2371

commit: 93f3983

@birkskyum

Copy link
Copy Markdown
Member

@lxsmnsyc , are you aware of anyone using 1.x?

@birkskyum
birkskyum merged commit 56f1c91 into 1.x Nov 2, 2026
7 checks passed
@birkskyum
birkskyum deleted the fix/upload-blob-metadata-1x branch November 2, 2026 13:20
@lxsmnsyc

lxsmnsyc commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@birkskyum personally no. Can be closed if no longer necessary.

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