Repository navigation
fix(plugins): read the catalog fields the catalog actually uses - #2403
Merged
Merged
Conversation
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.
Deploying pi-desktop with
|
| 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 |
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.
Why
The catalog is camelCase (
readmeMarkdown,safetyNotes,publisherId,iconUrl,artifactBaseUrl), butMarketCatalogEntryandMarketCatalogFilewere 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'sartifactBaseUrlnever reached package resolution.What
camelCase, with the snake_case spelling kept as a per-fieldaliasso a snapshot written by an older build still reads.null, and it cannot be repaired without the source, soensure_default_catalogrefreshes it once whencache-meta.jsoncarries nometadataGeneration; the marker is written by the next successful refresh, and a failed one leaves the snapshot and lets the next launch retry.plugins.publisherstring in all nine locales). The readme and the safety notes were already rendered by the sheet — they simply never had data.iconUrlis parsed and passed through, and the card keeps its monogram: the renderer performs no remote image loads (D169).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, anddetail_carries_readme_safety_notes_and_publisher(a file:// catalog throughmarket_get).apps/desktop/test/plugin-detail-metadata.test.mjs: the real sheet renders the readme, the safety callout andPublisher tioit-wang, and renders none of them when the catalog omits them.e2f137dff(machine environment).