Documentation / @etherfold/core / OpenedSpecsDisplaceOneAnotherError
Class: OpenedSpecsDisplaceOneAnotherError ​
Defined in: packages/core/src/container.ts:490
TWO SPECS OF ONE OPEN would both take the successor slot, and it holds AT MOST ONE (ADR-0084).
open registers every spec before it builds any engine (ADR-0088), and on a registry whose canonical is already named every other distinct spec goes into successor. A second one would DISPLACE the first -- its row and its state deleted by the shared rule (displacedBySuccessor, ADR-0071) -- while open still meant to build an engine for it, which left the container holding a fold nothing in the registry named.
REFUSED rather than resolved by list order, because a list is not a sequence of arrivals: nothing in it is "newer" than anything else, and letting the last-listed spec win would make what survives a function of how the caller spelled its array, which is the dependence ADR-0088 removed from follows. Refused BEFORE any spec of the same open is deleted, so the earlier spec keeps its row, its slot and its state; what the refused spec's factories opened is left exactly as a cap refusal leaves it. The fix is the caller's: open with at most one generation beside the canonical one, and add the next when it genuinely arrives -- that is the act successor replacement is for.
The CAPS do not prevent it, whatever they are: the displaced record is dropped BEFORE the arriving one is created, so the count never exceeds the cap (measured with the browser's two). What keeps a browser tab clear of it is that every browser host opens with ONE spec; it is reachable through openIndexer with several.
Extends ​
Error
Constructors ​
Constructor ​
new OpenedSpecsDisplaceOneAnotherError(
displaced,arriving):OpenedSpecsDisplaceOneAnotherError
Defined in: packages/core/src/container.ts:493
Parameters ​
displaced ​
The spec registered earlier in this open, which already holds successor.
arriving ​
The later spec whose registration would have displaced it.
Returns ​
OpenedSpecsDisplaceOneAnotherError
Overrides ​
Error.constructor
Properties ​
arriving ​
readonlyarriving:GenerationId
Defined in: packages/core/src/container.ts:497
The later spec whose registration would have displaced it.
cause? ​
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
Inherited from ​
Error.cause
displaced ​
readonlydisplaced:GenerationId
Defined in: packages/core/src/container.ts:495
The spec registered earlier in this open, which already holds successor.
message ​
message:
string
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from ​
Error.message
name ​
readonlyname:"OpenedSpecsDisplaceOneAnotherError"='OpenedSpecsDisplaceOneAnotherError'
Defined in: packages/core/src/container.ts:491
Overrides ​
Error.name
stack? ​
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from ​
Error.stack
Methods ​
isError() ​
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.error.d.ts:21
Indicates whether the argument provided is a built-in Error instance or not.
Parameters ​
error ​
unknown
Returns ​
error is Error
Inherited from ​
Error.isError