Repair error in grabImportedOid: it is OK for there to be no mapping

This commit is contained in:
Tony Garnock-Jones 2024-05-30 13:12:00 +02:00
parent a0ba43cfae
commit 4292c5f40f
1 changed files with 7 additions and 2 deletions

View File

@ -141,9 +141,14 @@ export abstract class LayerBoundary implements ProxyOutbound, ProxyInbound {
grabImportedOid(oid: IO.Oid, pins: Array<WireSymbol>): void {
const e = this.imported.grab("byOid", oid, false, null);
if (e === null) {
throw new Error("Internal error: import table missing entry for oid " + oid);
// This can happen if
// 1. remote peer asserts a value causing oid to be allocated
// 2. some local actor holds a reference to that entity
// 3. remote peer retracts the value
// 4. local actor uses the ref
} else {
pins.push(e);
}
pins.push(e);
}
grabExportedOid(oid: IO.Oid, pins: Array<WireSymbol>): Ref {