@@ -117,8 +117,8 @@ function installNextBlockedHalf(): void {
117117 // ONE emission (round 10.5, F7): the primitive self-gates on
118118 // consumers/machinery and bubbles ancestors internally —
119119 // compiled bodies reading INTO reverted children through
120- // nested chains are reached without a second ( duplicating)
121- // ancestor call on the undeduped lane path.
120+ // nested chains are reached without a duplicating ancestor
121+ // call on the undeduped lane path.
122122 if ( patchHooks !== null ) patchHooks . emitPatchOptimistic ( ot , null , null ) ;
123123 // Row-ops resync (family increment 2): reverts flip node values
124124 // back engine-natively; a driven list must rebuild retention by
@@ -543,8 +543,9 @@ function wipeStructuralOverrides(t: StoreNextTarget): void {
543543 }
544544 // Patch channel (override-consumption site): visible truth flipped to
545545 // committed for the consumed keys — force a re-apply from the live
546- // view so the DOM leaves the override state.
547- if ( t . pc !== null && t . pc . p !== null ) patchHooks ! . emitPatchOptimistic ( t , null , null ) ;
546+ // view so the DOM leaves the override state. ONE emission (round 10.5,
547+ // F7): the primitive self-gates and bubbles.
548+ if ( patchHooks !== null ) patchHooks . emitPatchOptimistic ( t , null , null ) ;
548549}
549550
550551/** Settle-time re-derivation (#3123 re-ruling, the second reckoning point):
@@ -603,73 +604,10 @@ export function consumeOverridesNext(fam: StoreNextFamily, replacing: boolean):
603604 let consumed = false ;
604605 runAuthoritative ( ( ) => {
605606 for ( const t of overlaid as Set < StoreNextTarget > ) {
606- const drop = ( node : Signal < any > , committed : any ) => {
607- if ( ! hasActiveOverride ( node ) ) return ;
608- const prev = unwrapOverride ( node . _x ?. _overrideValue ) ;
609- // Full legacy reset (clearOptimisticOverride parity): the landing is
610- // authoritative NOW — fold committed into the node directly instead
611- // of riding a transaction's commit (whose queues may be stashed with
612- // the transaction parked; the wake would strand until it settles).
613- ext ( node ) . _overrideValue = NOT_PENDING ;
614- node . _config |= CONFIG_OPTIMISTIC ;
615- const nx = ( node as any ) . _x ;
616- if ( nx ) {
617- nx . _overrideOwner = null ;
618- nx . _optimisticLane = undefined ;
619- }
620- node . _pendingValue = NOT_PENDING ;
621- node . _value = committed ;
622- if ( ! node . _equals || ! node . _equals ( prev , committed ) ) {
623- insertSubs ( node , true ) ;
624- schedule ( ) ;
625- }
626- } ;
627- // Landing consumes STRUCTURAL optimism only (legacy layer parity):
628- // membership edits, array length, and the value overrides written WITH
629- // them (a key carrying an active presence override is an add/delete —
630- // classified BEFORE the adoption may have made the key exist in landed
631- // data). A pure value override on a key the landing carries stays with
632- // its owning transaction (rapid-toggle contract: a live action's edit
633- // of an existing entity rides on top of landed truth).
634- const isArr = Array . isArray ( t . v ) ;
635- const has = t . h ;
636- let structuralKeys : Set < PropertyKey > | null = null ;
637- if ( has !== null ) {
638- for ( const key of Reflect . ownKeys ( has ) ) {
639- if ( hasActiveOverride ( has [ key as any ] ) ) ( structuralKeys ??= new Set ( ) ) . add ( key ) ;
640- }
641- }
642- const nodes = t . n ;
643- if ( nodes !== null ) {
644- for ( const key of Reflect . ownKeys ( nodes ) ) {
645- const structural =
646- structuralKeys ?. has ( key ) || ! ( key in t . v ) || ( isArr && key === "length" ) ;
647- if ( ! structural ) continue ;
648- drop (
649- nodes [ key as any ] ,
650- isArr && key === "length" ? ( t . v as any [ ] ) . length : t . v [ key as any ]
651- ) ;
652- }
653- }
654- if ( has !== null ) {
655- for ( const key of Reflect . ownKeys ( has ) ) drop ( has [ key as any ] , key in t . v ) ;
656- }
657- if ( t . k !== null && hasActiveOverride ( t . k ) ) {
658- ext ( t . k ) . _overrideValue = NOT_PENDING ;
659- t . k . _config |= CONFIG_OPTIMISTIC ;
660- const kx = ( t . k as any ) . _x ;
661- if ( kx ) {
662- kx . _overrideOwner = null ;
663- kx . _optimisticLane = undefined ;
664- }
665- insertSubs ( t . k , true ) ;
666- schedule ( ) ;
667- }
668- // Patch channel (override-consumption site): visible truth flipped to
669- // committed for the consumed keys — force a re-apply from the live
670- // view so the DOM leaves the override state. ONE emission (round
671- // 10.5, F7): the primitive self-gates and bubbles.
672- if ( patchHooks !== null ) patchHooks . emitPatchOptimistic ( t , null , null ) ;
607+ if ( ! contradicted . has ( t ) ) continue ;
608+ consumed = true ;
609+ overlaid . delete ( t ) ;
610+ wipeStructuralOverrides ( t ) ;
673611 }
674612 contradicted . clear ( ) ;
675613 } ) ;
0 commit comments