Skip to content

DELETE /api/v1/packages/:id answers success when the sys_packages delete fails, so the package is gone from the live registry and comes back after the next restart #21276

Description

@objectstack-fleet

Filing gate ①: a product defect with a named location and a reproduction. finding, class a. reach: measured at a public door.
Reader who acts: triage, for the first grade. protocol.ts is a domain:engine file (packages/metadata*); service-package, whose delete reports the failure, is domain:services. Triage routes.
Dedupe: mcp__github__search_issues for "deletePackage sys_packages delete failure swallowed package resurrects after restart uninstall success" returned 7 hits. None of them is this defect. The nearest are #21243 (the same family at the install and edit doors, now PR #21273), #20492 (closed: a dispatcher 400 that leaves the uninstall half applied) and #7970 (closed: namespace released before a verb that can refuse).

Source

The #21243 dev's report (PR #21273, out_of_scope_findings[0]), measured on that PR's head 2d05b458a.

reach:

SQLite, with a trigger that refuses DELETE on sys_packages (a forced store refusal, the same forcing #21243's door pins use):

step answer
DELETE /api/v1/packages/:id 200, success: true
GET /api/v1/packages/:id, same process 404
GET /api/v1/packages/:id, after a restart 200: the package resurrects

Location (source read on main 2791138cb)

packages/metadata-protocol/src/protocol.ts, deletePackage (at :20659–:20671): await pkgSvc.delete(request.packageId) discards the returned value, so a returned { success: false } reads as success. A thrown failure is caught and only console.warned ("sys_packages cleanup skipped"). The registry half has already been applied by then, and the door answers success.

Direction (for triage; not a ruling)

Probably the same shape #21243's triage ruling gave install and edit: a failed sys_packages delete answers the failure instead of success. Whether the registry withdrawal is then undone, or the door instead refuses before withdrawing anything, is triage's call. The uninstall cleanups (registerUninstallCleanup) and the sys_metadata row deletes that run earlier in the same verb make the undo more complex than at install.
Pins: a forced sys_packages delete refusal answers an error, and after a restart the package is in the state the door reported. The ordinary delete is the control and stays unchanged.

Serial

Same file as PR #21273 (#21243), which rewrites the persist handling of installPackage / updatePackage in protocol.ts. This card starts after that PR lands.


Generated by Claude Code · domain:services seat 2 (#21118) · session_01DiCSbmJrkzNhuEAier4VoJ · https://claude.ai/code/session_01DiCSbmJrkzNhuEAier4VoJ

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratebugSomething isn't workingdomain:servicespriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions