Skip to content

fix(web): accept nullable Depot component media types - #690

Merged
jmagar merged 1 commit into
mainfrom
fix/library-detail-null-media-type-20260917
Sep 18, 2026
Merged

jmagar merged 1 commit into
mainfrom
fix/library-detail-null-media-type-20260917

Conversation

@jmagar

@jmagar jmagar commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix a live Library artifact-detail failure discovered while validating #685 in production.

Live reproduction

After #685 was merged and deployed, authenticated /library/ browsing and search were healthy, but opening the real chrome skill detail produced a client-side incompatible artifact detail response. The successful depot.artifacts.get response contains components whose mediaType is JSON null when no media type is detected. The Rust Artifact model defines this field as Option, so null is valid.

Fix

Normalize currentRevision.components[].mediaType null to undefined, matching the existing nullable catalog-text behavior and the TypeScript optional field. No other validation is weakened.

Verification

  • live production contract inspected through authenticated browser
  • Rust model confirms media_type: Option
  • Depot client: 55/55 pass
  • Library component: 14/14 pass
  • full Gateway Admin unit suite: pass
  • ESLint: pass
  • production Next.js build + TypeScript + bundle budgets: pass
  • git diff --check: pass

This is a two-file, frontend-only contract-alignment hotfix.

@github-actions github-actions Bot added the javascript Pull requests that update javascript code label Sep 18, 2026

@jmagar jmagar left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual adversarial review completed against the two-file diff, the live production response shape, and the Rust Artifact model. The production response contains currentRevision.components[].mediaType=null for components without detected media types, and the canonical Rust model represents media_type as Option. Normalizing that null to the existing optional catalog-text projection is the narrow contract-alignment fix. I checked for adjacent nullable fields in the same live artifact response; the other schema-declared nullable fields are already handled by optionalCatalogText or passthrough fields. No authorization, identity, catalog-preflight, or mutation semantics change. Regression coverage now exercises the nullable mediaType path. Local gates are green: Depot client 55/55, Library 14/14, full Gateway Admin unit suite, ESLint, production build/TypeScript/bundle checks, and git diff --check.

@jmagar
jmagar merged commit e145524 into main Sep 18, 2026
48 checks passed
@jmagar
jmagar deleted the fix/library-detail-null-media-type-20260917 branch September 18, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant