Skip to content

fix(plugins): read the catalog fields the catalog actually uses - #2403

Merged
vastsa merged 1 commit into
mainfrom
fix/catalog-entry-metadata
Nov 17, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/catalog-entry-metadata

Conversation

@vastsa

@vastsa vastsa commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Why

The catalog is camelCase (readmeMarkdown, safetyNotes, publisherId, iconUrl, artifactBaseUrl), but MarketCatalogEntry and MarketCatalogFile were declared snake_case. Serde dropped every multi-word field without an error, so a plugin's readme, safety notes and publisher never reached the detail sheet — it described a plugin with an empty body — and a mirror's artifactBaseUrl never reached package resolution.

What

  • Parsing: both structs now name camelCase, with the snake_case spelling kept as a per-field alias so a snapshot written by an older build still reads.
  • Migration: that old snapshot records the dropped fields as null, and it cannot be repaired without the source, so ensure_default_catalog refreshes it once when cache-meta.json carries no metadataGeneration; the marker is written by the next successful refresh, and a failed one leaves the snapshot and lets the next launch retry.
  • Rendering: the detail sheet shows the publisher beside the display author (new plugins.publisher string in all nine locales). The readme and the safety notes were already rendered by the sheet — they simply never had data.
  • iconUrl is parsed and passed through, and the card keeps its monogram: the renderer performs no remote image loads (D169).
  • Spec §7 now lists the publisher, readme and safety notes as required detail content; changelog 0.23.0 in all nine languages.

Tests

  • crates/host-core: every_camel_case_field_reaches_the_entry, a_snapshot_written_by_an_older_build_still_reads, what_the_client_writes_is_what_the_client_reads, and detail_carries_readme_safety_notes_and_publisher (a file:// catalog through market_get).
  • apps/desktop/test/plugin-detail-metadata.test.mjs: the real sheet renders the readme, the safety callout and Publisher tioit-wang, and renders none of them when the catalog omits them.
  • Full host-core suite: 1330 pass, plus the 2 failures that fail identically on base e2f137dff (machine environment).
  • Desktop typecheck, biome, and the marketplace/render/IPC tests pass. The Electron browse test's wait budget was raised because it was timing out only when the whole suite ran in parallel.

The catalog document is camelCase, but the entry and file structs were
declared snake_case, so every multi-word field was dropped: readmeMarkdown,
safetyNotes, publisherId and iconUrl never reached a detail sheet, and
artifactBaseUrl never reached package resolution. The detail sheet was
therefore rendering a plugin with no description of itself.

The structs now name camelCase and keep snake_case as an alias, because a
snapshot written by an older build is still on disk. That snapshot cannot
be repaired without the source, so one guarded refresh replaces it and a
marker keeps the next launch from repeating the request.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying pi-desktop with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0eea8b4
Status: ✅  Deploy successful!
Preview URL: https://4348d0d9.pi-desktop.pages.dev
Branch Preview URL: https://fix-catalog-entry-metadata.pi-desktop.pages.dev

View logs

@vastsa
vastsa merged commit 047c4ea into main Nov 17, 2026
7 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