Skip to content

Commit c3c5822

Browse files
committed
fix(octane): ensure tentative falling edge renders when drain skips block
fallTransitionHook pre-sets isPending=false on the hook when its block has a queued render in the drain. If the drain later skips that render (aborted root transaction, retired subtree, or hidden-boundary redirect), the pre-set value is never rendered. When finishTransitionHookBatch then calls publish(false), it no-ops because isPending already matches, leaving the UI stuck on the rising edge. Fix: when publish sees that isPending already matches but the value was tentatively pre-set (wasTentative && !pending), proceed to schedule the render instead of returning early.
1 parent bede4dc commit c3c5822

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎packages/octane/src/runtime.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44291,9 +44291,17 @@ export function useTransition(
4429144291
if (!block.disposed) runTransition(fn, hook);
4429244292
},
4429344293
publish: (pending) => {
44294+
const wasTentative = hook.tentative;
4429444295
hook.tentative = false;
44295-
if (hook.isPending === pending || block.disposed) return;
44296-
hook.isPending = pending;
44296+
if (block.disposed) return;
44297+
if (hook.isPending === pending) {
44298+
// A tentative falling edge must still schedule a render: the drain
44299+
// may have skipped the block (aborted root, retired subtree, hidden
44300+
// boundary), so the pre-set value was never rendered.
44301+
if (!wasTentative || pending) return;
44302+
} else {
44303+
hook.isPending = pending;
44304+
}
4429744305
TRANSITION_LISTENER_PUBLISH_DEPTH++;
4429844306
try {
4429944307
if (typeof __OCTANE_PROFILE_ENABLED__ !== 'undefined' && __OCTANE_PROFILE_ENABLED__)

0 commit comments

Comments
 (0)