Skip to content

Commit 9dd4abe

Browse files
committed
wip(metadata-protocol): read the installed version beside the withdrawal
Claude-Session: https://claude.ai/code/session_017ihL2bwU56eMCkj69h7Gd8 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6d11c86 commit 9dd4abe

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎packages/metadata-protocol/src/protocol-package-uninstall.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ export async function deletePackage(this: Pick<PackageUninstallHost, 'deleteMeta
146146
packageRegistry.assertPackageUninstallable(request.packageId);
147147
}
148148

149-
// [#31186] What the running registry holds for this id, read before
150-
// anything is removed: whether there is a package to uninstall at all, and
151-
// its version, for the package's own ledger row at the end of this verb.
152-
const installed = readInstalledPackage(packageRegistry, request.packageId);
153-
154149
// [#23473, ADR-0048] THE SHARED-OBJECT REFUSAL, ALSO ASKED BEFORE THE
155150
// STORE DELETE. A `sys_metadata` row is keyed by its package, so an
156151
// object this package holds can also be held by another package's row,
@@ -343,6 +338,10 @@ export async function deletePackage(this: Pick<PackageUninstallHost, 'deleteMeta
343338
// time: it is logged, not fatal, because the durable row is already
344339
// gone and the next boot is clean either way.
345340
//
341+
// [#31186] What the registry holds for this id, read before the withdrawal
342+
// below releases it: whether there was a package to uninstall, and its
343+
// version, for the package's own ledger row at the end of this verb.
344+
const installed = readInstalledPackage((this.engine as any)?.registry, request.packageId);
346345
// [ADR-0090 D5] What the package declared is captured first: the
347346
// withdrawal releases its names, and the cleanups below revoke the
348347
// grants that name them.

0 commit comments

Comments
 (0)