Follow-up from the #404 review (merged as eb791a3).
Problem
beginNodeDetailAuthoringFinalization and the builder mutation guards in packages/graph-client/src/detail.ts throw the identical bare Error("Node Detail authoring is finalized and cannot be mutated") in two different situations:
- the builder is permanently frozen after a successful submit;
- a finalization is in flight (
state.finalization set, cancellable) and another caller touches the builder.
A second RelayerGraphClient instance that submits the same NodeObject while the first client's finalization is still awaiting the resolver hits case 2 and is told the builder is "finalized" although nothing was finalized and a retry a moment later would succeed. setComponent/clear() during the window get the same message.
Fix
Give the in-flight case its own message and a machine-readable code (for example detail_finalization_in_progress), keep the permanent case as detail_finalized, and add a test with two client instances where the second submits while the first is gated on the resolver. All existing tests submit a node through one client instance only.
Evidence
Adversarial review of caacfca on #404, finding "F7 — PARTIALLY FIXED: the in-flight lock error is unchanged and indistinguishable".
Follow-up from the #404 review (merged as
eb791a3).Problem
beginNodeDetailAuthoringFinalizationand the builder mutation guards inpackages/graph-client/src/detail.tsthrow the identical bareError("Node Detail authoring is finalized and cannot be mutated")in two different situations:state.finalizationset, cancellable) and another caller touches the builder.A second
RelayerGraphClientinstance that submits the sameNodeObjectwhile the first client's finalization is still awaiting the resolver hits case 2 and is told the builder is "finalized" although nothing was finalized and a retry a moment later would succeed.setComponent/clear()during the window get the same message.Fix
Give the in-flight case its own message and a machine-readable
code(for exampledetail_finalization_in_progress), keep the permanent case asdetail_finalized, and add a test with two client instances where the second submits while the first is gated on the resolver. All existing tests submit a node through one client instance only.Evidence
Adversarial review of
caacfcaon #404, finding "F7 — PARTIALLY FIXED: the in-flight lock error is unchanged and indistinguishable".