Skip to content

fix(scripts): derive consent-preview fields from the signed manifest - #2

Merged
agalwood merged 1 commit into
mainfrom
fix/entry_sync_manifest_permissions_20260724
Jul 24, 2026
Merged

fix(scripts): derive consent-preview fields from the signed manifest#2
agalwood merged 1 commit into
mainfrom
fix/entry_sync_manifest_permissions_20260724

Conversation

@agalwood

Copy link
Copy Markdown
Member

What

entry-from-release regenerated a builtin's registry entry but wrote only version + package, leaving permissions / optionalPermissions / hostPermissions / engines as hand-authored leftovers that silently drift from the plugin's actual signed manifest.

Incident: motrix.filename-template@1.1.0 dropped hostPermissions from its manifest, yet the live entry still advertises ["*://*/*"] — the consent preview shown on the website and in-app no longer matches what the plugin requests, and the offered update fails to install client-side.

How

buildPackageBlock now mirrors engines + the three permission arrays off the already-signature-verified manifest (new ManifestMirror), and patchEntry writes them unconditionally alongside version + package — no code path lets a stale value survive. Absent optional manifest fields land as [] (identical to the wire schema's .default([]) materialization). A missing engines.motrix aborts as a corrupt manifest. Editorial fields (name/description/categories/features/…) remain hand-authored.

Test plan

  • 7 new tests incl. the exact incident shape (manifest without hostPermissions clears the stale wildcard and stays schema-valid): pnpm test → 27 passed
  • pnpm check clean, pnpm validate → 3 entries valid

entry-from-release regenerated a builtin's registry entry but wrote only
version + package, leaving permissions / optionalPermissions /
hostPermissions and engines as hand-authored leftovers that silently
drifted from the plugin's actual manifest.

Incident: motrix.filename-template@1.1.0 dropped hostPermissions from its
manifest, yet the entry kept advertising a broad wildcard host grant. The
website and app showed a healthy update that then failed to install
client-side — the registry lied to users about what the plugin requests.

buildPackageBlock now mirrors engines + the three permission arrays off
the already-verified SIGNED manifest and carries them in the returned
block; patchEntry writes them unconditionally so a stale value can never
survive. Absent optional manifest fields (hostPermissions /
optionalPermissions) land as [], which the registry wire schema's
.default([]) accepts and materializes identically for consumers. A
missing engines.motrix is treated as a corrupt manifest and aborts.
@agalwood
agalwood merged commit b3ab7d4 into main Jul 24, 2026
1 check passed
@agalwood
agalwood deleted the fix/entry_sync_manifest_permissions_20260724 branch July 24, 2026 08:33
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