Skip to content

test(api): MediaLit client fixtures for v0.8.0 responses - #934

Merged
s3rot0n1n merged 1 commit into
platform-based-rewritefrom
test/medialit-v080-fixtures
Nov 26, 2026
Merged

s3rot0n1n merged 1 commit into
platform-based-rewritefrom
test/medialit-v080-fixtures

Conversation

@s3rot0n1n

Copy link
Copy Markdown
Contributor

The MediaLit client tests stubbed /media/get and /media/seal with v0.7.1-shaped responses: no processing or derivatives, and the same PNG at upload and seal. MediaLit v0.8.0 changed both, so the tests passed without showing the client handles what production now returns.

Only apps/api/src/media-lit-client.test.ts changes. The fixtures are replaced, not added alongside, and follow MediaLit's v0.8.0 source:

  • Lifecycle: /media/get returns the original PNG with processing: {status: "pending"} until the media is sealed; /media/seal returns main.webp, image/webp and a smaller size with processing: {status: "ready"} and a thumbnail derivative. inspectUpload reports the PNG, finalizeUpload the WebP, getAsset the sealed asset, and sealing twice returns the same asset. Whole-result toEqual checks show the new fields are ignored.
  • Failed conversion: processing: {status: "failed", error} with the original kept still parses to the PNG's values.
  • Seal already running: a 503 with Retry-After: 1 makes finalizeUpload throw medialit_request_failed_503 after one request. This records current behaviour; there's no retry.

No client bug found. downloads.test.ts is unchanged: its fake works at the MediaLitClient interface, not HTTP bodies.

Testing (apps/api): bun test src/media-lit-client.test.ts 4 pass, 0 fail; bun run typecheck passes. bun run lint fails with 11 errors in files this PR doesn't touch; the base commit has the same counts.

🤖 Generated with Claude Code

Stub /media/get and /media/seal with MediaLit v0.8.0 bodies, which add
`processing` and `derivatives` and convert images to WebP at seal time.
The fake is now stateful: get returns the unsealed PNG until sealed, and
a repeat seal answers 200 with the sealed media.

Cover that inspectUpload reports the original PNG while finalizeUpload
reports the sealed WebP, that a failed conversion (original kept) still
parses, and that a 503 seal-in-progress surfaces as
medialit_request_failed_503 without a retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T12:41:44.015740Z f0b363d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@s3rot0n1n
s3rot0n1n merged commit c156987 into platform-based-rewrite Nov 26, 2026
5 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.

1 participant