@@ -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
@@ -535,8 +535,9 @@ function wipeStructuralOverrides(t: StoreNextTarget): void {
535535 }
536536 // Patch channel (override-consumption site): visible truth flipped to
537537 // committed for the consumed keys — force a re-apply from the live
538- // view so the DOM leaves the override state.
539- if ( t . pc !== null && t . pc . p !== null ) patchHooks ! . emitPatchOptimistic ( t , null , null ) ;
538+ // view so the DOM leaves the override state. ONE emission (round 10.5,
539+ // F7): the primitive self-gates and bubbles.
540+ if ( patchHooks !== null ) patchHooks . emitPatchOptimistic ( t , null , null ) ;
540541}
541542
542543/** Settle-time re-derivation (#3123 re-ruling, the second reckoning point):
@@ -595,73 +596,10 @@ export function consumeOverridesNext(fam: StoreNextFamily, replacing: boolean):
595596 let consumed = false ;
596597 runAuthoritative ( ( ) => {
597598 for ( const t of overlaid as Set < StoreNextTarget > ) {
598- const drop = ( node : Signal < any > , committed : any ) => {
599- if ( ! hasActiveOverride ( node ) ) return ;
600- const prev = unwrapOverride ( node . _x ?. _overrideValue ) ;
601- // Full legacy reset (clearOptimisticOverride parity): the landing is
602- // authoritative NOW — fold committed into the node directly instead
603- // of riding a transaction's commit (whose queues may be stashed with
604- // the transaction parked; the wake would strand until it settles).
605- ext ( node ) . _overrideValue = NOT_PENDING ;
606- node . _config |= CONFIG_OPTIMISTIC ;
607- const nx = ( node as any ) . _x ;
608- if ( nx ) {
609- nx . _overrideOwner = null ;
610- nx . _optimisticLane = undefined ;
611- }
612- node . _pendingValue = NOT_PENDING ;
613- node . _value = committed ;
614- if ( ! node . _equals || ! node . _equals ( prev , committed ) ) {
615- insertSubs ( node , true ) ;
616- schedule ( ) ;
617- }
618- } ;
619- // Landing consumes STRUCTURAL optimism only (legacy layer parity):
620- // membership edits, array length, and the value overrides written WITH
621- // them (a key carrying an active presence override is an add/delete —
622- // classified BEFORE the adoption may have made the key exist in landed
623- // data). A pure value override on a key the landing carries stays with
624- // its owning transaction (rapid-toggle contract: a live action's edit
625- // of an existing entity rides on top of landed truth).
626- const isArr = Array . isArray ( t . v ) ;
627- const has = t . h ;
628- let structuralKeys : Set < PropertyKey > | null = null ;
629- if ( has !== null ) {
630- for ( const key of Reflect . ownKeys ( has ) ) {
631- if ( hasActiveOverride ( has [ key as any ] ) ) ( structuralKeys ??= new Set ( ) ) . add ( key ) ;
632- }
633- }
634- const nodes = t . n ;
635- if ( nodes !== null ) {
636- for ( const key of Reflect . ownKeys ( nodes ) ) {
637- const structural =
638- structuralKeys ?. has ( key ) || ! ( key in t . v ) || ( isArr && key === "length" ) ;
639- if ( ! structural ) continue ;
640- drop (
641- nodes [ key as any ] ,
642- isArr && key === "length" ? ( t . v as any [ ] ) . length : t . v [ key as any ]
643- ) ;
644- }
645- }
646- if ( has !== null ) {
647- for ( const key of Reflect . ownKeys ( has ) ) drop ( has [ key as any ] , key in t . v ) ;
648- }
649- if ( t . k !== null && hasActiveOverride ( t . k ) ) {
650- ext ( t . k ) . _overrideValue = NOT_PENDING ;
651- t . k . _config |= CONFIG_OPTIMISTIC ;
652- const kx = ( t . k as any ) . _x ;
653- if ( kx ) {
654- kx . _overrideOwner = null ;
655- kx . _optimisticLane = undefined ;
656- }
657- insertSubs ( t . k , true ) ;
658- schedule ( ) ;
659- }
660- // Patch channel (override-consumption site): visible truth flipped to
661- // committed for the consumed keys — force a re-apply from the live
662- // view so the DOM leaves the override state. ONE emission (round
663- // 10.5, F7): the primitive self-gates and bubbles.
664- if ( patchHooks !== null ) patchHooks . emitPatchOptimistic ( t , null , null ) ;
599+ if ( ! contradicted . has ( t ) ) continue ;
600+ consumed = true ;
601+ overlaid . delete ( t ) ;
602+ wipeStructuralOverrides ( t ) ;
665603 }
666604 contradicted . clear ( ) ;
667605 } ) ;
0 commit comments