fix(registry): refresh package metadata on re-announce#119
Merged
Conversation
upsertPackage had an empty update clause, so re-announcing an existing bundle never refreshed manifest-derived metadata (display_name, description, icon, author, homepage, license, serverType). Only the version moved (via updateLatestVersion). This left 44 of 49 bundles showing display_name: null even after publishing with the field set. Populate the update clause with the manifest-derived fields. Prisma skips undefined values, so a manifest omitting a field preserves the existing value rather than nulling it. Ownership/trust (verified, createdBy, claimedBy/At) and version ordering are left untouched.
…/update fields Addresses QA review on #119: - Add package.repository.test.ts: asserts the announce update payload refreshes manifest-derived metadata AND omits ownership/trust + version fields (verified, latestVersion, createdBy, claimedBy, claimedAt). Pins the intentional exclusions so a future edit adding any of them to the update clause — or reverting to update: {} — fails loudly. - Hoist the shared manifest fields into one object reused by both create and update so the two clauses can't drift (the original bug was exactly create/update drift).
f3c6df3 to
b9eed0f
Compare
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.
Problem
upsertPackagehas an emptyupdate: {}clause. When a bundle already exists, an announce updates nothing about the package row — notdisplay_name,description,icon, orauthor. The version moves only becauseupdateLatestVersionruns separately.Result: 44 of 49 registry bundles show
display_name: nulleven when republished with the field set in the manifest. It also meansdescription/icon/authoredits never propagate on re-release.Confirmed live:
@nimblebraininc/abstractv0.2.3 was released withdisplay_name: "Abstract"in the manifest; CI green,latest_versionmoved to 0.2.3, but the API still returnsdisplay_name: null.Fix
Populate the
updateclause with the manifest-derived fields. Prisma skipsundefined, so a manifest that omits a field preserves the existing value rather than nulling it. Ownership/trust (verified,createdBy,claimedBy/At) and version ordering (latestVersion, handled byupdateLatestVersion) are intentionally left untouched.Verification
pnpm --filter @nimblebrain/mpak-registry typecheck✓pnpm --filter @nimblebrain/mpak-registry lint✓pnpm --filter @nimblebrain/mpak-registry test✓ (130 passed)pnpm --filter @nimblebrain/mpak-registry build✓display_namepopulates.