Relationships
#2745 serve reload keeps a removed extension's add-on methods on built-in and local model types
Opened by stack72 · 9/29/2026· Shipped 9/30/2026
Summary
After swamp-club#2742, a serve reload unregisters the types of a pulled extension that was removed from the lockfile. One case remains. A removed extension can add methods to a model type it does not own, through a model add-on (catalog kind extension). If that base type is built in or comes from a local extension, the added methods stay attached until serve restarts.
Why
When the base type is a surviving pulled type, the reload's register loop invalidates it and attaches its add-ons again from the catalog, so the removed add-on drops. A built-in or local base type is never re-registered by the reload, and invalidating it to drop the add-on would delete the built-in type itself. The attached members live in the attachedExtensions map in src/domain/extensions/model_kind_adapter.ts. removeAttachedExtensionsForType clears every add-on for a base type, not just the ones the removed extension provided.
Steps to reproduce
- On a managedConfig serve, pull an extension that adds a method to a built-in model type.
- Run swamp extension rm for that extension (on this instance or a peer).
- After the next config poll, the added method is still listed on the base type and still runs.
Expected
The reload detaches only the members the removed extension provided, leaving the base type and any other add-ons in place.
Found while implementing swamp-club#2742. Not reproduced yet.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.