Repository navigation
fix(1.x): keep file and blob metadata in server function uploads - #2371
Merged
Merged
Conversation
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 detectedLatest commit: 93f3983 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
Member
|
@lxsmnsyc , are you aware of anyone using 1.x? |
Member
Author
|
@birkskyum personally no. Can be closed if no longer necessary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aFilenamedblob, an empty type becomesapplication/octet-stream,lastModifiedis the time the server parsed the request, and%22in a name is decoded to".The upload node now carries the type, plus the name and
lastModifiedfor a file. The server rebuilds aBloborFilefrom 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 fieldspackages/start/src/runtime/uploads.test.ts: tests for blobs, empty types, exact names,lastModified, and index-only nodes@solidjs/startChecked locally:
tsc --noEmitandvitest run(133 tests). The empty-type and name/lastModifiedtests fail without the fix.🤖 Generated with Claude Code