feat(metadata): optional name display-title Upload-Metadata key - #56
Merged
Conversation
Carry a free-form, human-facing artifact title (e.g. the draft name typed on the capture device) from create -> sidecar -> consumer, so a downstream service can label an artifact instead of inventing a title from the opaque artifactId. - Parse `name` from Upload-Metadata; trim + hard-cap (512) server-side, drop empty/whitespace to no-name. - Thread through ReserveUploadParams; persist in both the local and S3 sidecars alongside relatedTo/checksum. - Expose via a new optional `getName` storage method (both adapters). - Docs: PROTOCOL.md 4.1 (+ UTF-8 base64 note), README metadata table + sidecar layout, CHANGELOG. - Tests: round-trip, UTF-8 fidelity, absent/whitespace -> no name, length cap, unknown id. Optional everywhere -- old clients that don't send it and consumers that don't read it are unaffected (PROTOCOL 9 non-normative extension).
jlocala1
force-pushed
the
feat/artifact-name-metadata
branch
from
July 28, 2026 19:37
b1497a8 to
982de79
Compare
Read the new Upload-Metadata.name off the sidecar (`sidecar.name ?? null`) so the reference demo shows the display title, not just persists it — and documents how a consumer reads the field. Free-form/client-supplied, so the comment notes a UI must escape it.
Publishable version carrying the optional `name` Upload-Metadata field, so downstream consumers (PulseClip) can pin `@mieweb/pulsevault@0.1.2` once this lands and is published.
There was a problem hiding this comment.
Pull request overview
Adds support for an optional human-facing artifact display title via the TUS Upload-Metadata.name key, threading it through the upload reservation path into sidecar metadata and exposing it via a new optional storage accessor.
Changes:
- Parse and normalize
Upload-Metadata.nameserver-side (trim + cap) and pass it throughReserveUploadParams. - Persist
namein both local and S3 sidecars and expose it viastorage.getName(artifactId). - Add tests and documentation updates describing the new metadata key and sidecar shape.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/helpers.mjs | Extends TUS test helpers to send name in Upload-Metadata. |
| test/artifact-name.test.mjs | New test suite covering name round-trip, trimming/cap, UTF-8, and null behavior. |
| src/storage/types.ts | Adds ReserveUploadParams.name and optional PulseVaultStorage.getName. |
| src/storage/local.ts | Stores/loads/caches name in the local sidecar and implements getName. |
| src/storage/s3.ts | Stores/loads/caches name in the S3 sidecar and implements getName. |
| src/lib/pulsevaultTus.ts | Parses name from upload metadata and passes it into reserveUpload. |
| README.md | Documents the new name metadata key and local sidecar layout update. |
| PROTOCOL.md | Documents name as an Upload-Metadata key in the protocol table. |
| examples/fastify-demo/server.mjs | Surfaces sidecar name in the demo “videos” listing output. |
| CHANGELOG.md | Adds an entry describing the new name metadata feature. |
| package.json | Bumps package version to 0.1.2. |
| package-lock.json | Updates lockfile version fields to 0.1.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…Name - Cap the `name` metadata by Unicode code point (Array.from) instead of UTF-16 units, so truncating at the 512 boundary can't split a surrogate pair into a lone half. Adds a boundary-emoji regression test. - PROTOCOL.md: note that a free-form metadata value (name) must be base64 of its UTF-8 bytes, not a Latin-1 btoa. - README.md: list getName/name in the local + S3 adapter method summaries, the S3 sidecar layout, and the custom-adapter example.
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.
Add an optional
namedisplay-title toUpload-MetadataCarries a free-form, human-facing artifact title (e.g. the draft name typed on the capture device) from create → sidecar → consumer, so a downstream service can label an artifact instead of inventing a title from the opaque
artifactId.What
nameUpload-Metadatakey; trim + hard-cap at 512 server-side; drop empty/whitespace to no-name.ReserveUploadParams; persist in the local and S3 sidecars alongsiderelatedTo/checksum.getNamestorage method (both adapters).Docs
PROTOCOL.md§4.1 metadata table + a note that free-form values must be UTF-8 base64 (a browserbtoa()alone corrupts accents/emoji).[Unreleased] → Added.Tests
Round-trip to sidecar +
getName; UTF-8 fidelity (accents/emoji); absent and whitespace-only → no name; length cap; unknown id.npm test→ 117/117 green.Compatibility
Optional everywhere — clients that don't send
nameand consumers that don't read it are unaffected. A non-normative extension perPROTOCOL.md§9; noprotocolVersionbump.