Repair error in halfLink accounting during facet termination

This commit is contained in:
Tony Garnock-Jones 2021-12-12 23:01:53 +01:00
parent 414b971cee
commit 364c97f357
1 changed files with 8 additions and 1 deletions

View File

@ -164,7 +164,14 @@ export class Facet {
}
isInert(): boolean {
return this.children.size === 0 && this.outbound.size === 0 && this.inertCheckPreventers === 0;
const noKids = this.children.size === 0;
const noOutboundHandles = this.outbound.size === 0;
// The only outbound handle the root facet of an actor may have is a link
// assertion, from _halfLink(). This is not to be considered a "real"
// assertion for purposes of keeping the facet alive!
const isRootFacet = this.parent === null;
const noInertCheckPreventers = this.inertCheckPreventers === 0;
return noKids && (noOutboundHandles || isRootFacet) && noInertCheckPreventers;
}
preventInertCheck(): () => void {