Skip to content

fix: surface unmapped platform combinations instead of dropping silently - #72

Merged
dopry merged 1 commit into
nextfrom
claude/fix-unmapped-platform-combos
Jul 22, 2026
Merged

fix: surface unmapped platform combinations instead of dropping silently#72
dopry merged 1 commit into
nextfrom
claude/fix-unmapped-platform-combos

Conversation

@dopry

@dopry dopry commented Jul 22, 2026

Copy link
Copy Markdown
Owner

filenameToPlatform's composite-id lookup returned undefined for discrete parts that don't combine into a modeled id — e.g. a universal token on a linux asset (myapp-universal.tar.gzlinux_universal) or a non-msix windows asset (myapp-win64-universal.zipwindows_universal). Ingestion then skipped those assets without logging anything, and the function violated its declared Platform return type.

Changes:

  • filenameToPlatform now throws a descriptive Unrecognized platform combination (...) error for unmapped combos; normalizeRelease's existing per-asset try/catch logs the drop instead of skipping silently.
  • On /download/:tag/:filename, filename detection failures are mapped to a 400 (BadRequestError) — previously an unparseable filename surfaced as a 500.

Includes unit tests for the throwing combos and an integration test for the 400.

From the 2.0 release review pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AtqCsX7ptP36t5rdyaJJhM


Generated by Claude Code

filenameToPlatform's composite-id lookup returned undefined for discrete
parts with no modeled id (a 'universal' token on linux or non-msix
windows assets), so ingestion skipped those assets without logging
anything and the function violated its declared return type. Throw a
descriptive error instead: ingestion already logs detection errors per
asset, and the /download/:tag/:filename route maps detection failures to
a 400 (previously a 500 for unparseable filenames).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AtqCsX7ptP36t5rdyaJJhM

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens platform parsing by making unsupported filename-derived platform combinations explicit errors (instead of returning undefined), and then translating those parse failures into visible drops during ingestion and a client-facing 400 on the download-by-filename route.

Changes:

  • filenameToPlatform now throws Unrecognized platform combination (...) when discrete parts don’t map to a modeled composite Platform.
  • /download/:tag/:filename maps filename platform-parse failures to BadRequestError (400) instead of surfacing as a 500.
  • Adds unit coverage for unmapped combinations and an integration test asserting the 400 behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/unit/platforms.spec.ts Adds assertions that unmapped discrete parts now throw a descriptive error.
test/integration/download.spec.ts Verifies invalid filename-to-platform parsing returns HTTP 400 on download-by-filename route.
src/utils/platforms.ts Converts missing composite platform lookup from undefined to a thrown, descriptive error.
src/http/downloads.ts Wraps filename-derived platform parsing errors as BadRequestError to return 400.

@dopry
dopry merged commit db02442 into next Jul 22, 2026
3 checks passed
@dopry
dopry deleted the claude/fix-unmapped-platform-combos branch July 22, 2026 03:00
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.

3 participants